From bd9ef2429c321113ad9dbbc8c6f5b729cac861ac Mon Sep 17 00:00:00 2001 From: rohitthakur2590 Date: Mon, 24 Jun 2024 21:01:35 +0530 Subject: [PATCH 1/4] remove traces Signed-off-by: rohitthakur2590 --- plugins/connection/persistent.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/connection/persistent.py b/plugins/connection/persistent.py index 549299f3f..3c05bdb21 100644 --- a/plugins/connection/persistent.py +++ b/plugins/connection/persistent.py @@ -72,7 +72,17 @@ def run(self): "starting connection from persistent connection plugin", host=self._play_context.remote_addr, ) - variables = {"ansible_command_timeout": self.get_option("persistent_command_timeout")} + variables = { + "ansible_command_timeout": self.get_option( + "persistent_command_timeout" + ), + "remote_addr": self.get_option("remote_addr"), + "remote_user": self.get_option("remote_user"), + "password": self.get_option("password"), + "port": self.get_option("port"), + "private_key_file": self.get_option("private_key_file") + } + self._play_context.connection socket_path = start_connection(self._play_context, variables, self._task_uuid) display.vvvv( "local domain socket path is %s" % socket_path, From 507e1689d83b57d08ff55072b7203c6027f1484c Mon Sep 17 00:00:00 2001 From: rohitthakur2590 Date: Mon, 1 Jul 2024 11:39:40 +0530 Subject: [PATCH 2/4] Include persistent options Signed-off-by: rohitthakur2590 --- plugins/connection/persistent.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/plugins/connection/persistent.py b/plugins/connection/persistent.py index 3c05bdb21..c9767872e 100644 --- a/plugins/connection/persistent.py +++ b/plugins/connection/persistent.py @@ -72,18 +72,11 @@ def run(self): "starting connection from persistent connection plugin", host=self._play_context.remote_addr, ) - variables = { - "ansible_command_timeout": self.get_option( - "persistent_command_timeout" - ), - "remote_addr": self.get_option("remote_addr"), - "remote_user": self.get_option("remote_user"), - "password": self.get_option("password"), - "port": self.get_option("port"), - "private_key_file": self.get_option("private_key_file") - } - self._play_context.connection - socket_path = start_connection(self._play_context, variables, self._task_uuid) + options = self.get_options() + options["ansible_command_timeout"] = self.get_option("persistent_command_timeout") + for option in self._options.keys(): + options[option] = self.get_option(option) + socket_path = start_connection(self._play_context, options, self._task_uuid) display.vvvv( "local domain socket path is %s" % socket_path, host=self._play_context.remote_addr, From dfaf6455dc637065dd6d94007bc303eb477ca4ab Mon Sep 17 00:00:00 2001 From: rohitthakur2590 Date: Mon, 1 Jul 2024 11:46:00 +0530 Subject: [PATCH 3/4] add changelog Signed-off-by: rohitthakur2590 --- changelogs/fragments/fix_f5_remote_addr_mapping.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelogs/fragments/fix_f5_remote_addr_mapping.yaml diff --git a/changelogs/fragments/fix_f5_remote_addr_mapping.yaml b/changelogs/fragments/fix_f5_remote_addr_mapping.yaml new file mode 100644 index 000000000..f39d446d6 --- /dev/null +++ b/changelogs/fragments/fix_f5_remote_addr_mapping.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - Correctly supply the provided variables(remote server,host,port) addr as part of options to persistent connection. From 67e128649c851199728fe000716fb30910506799 Mon Sep 17 00:00:00 2001 From: rohitthakur2590 Date: Mon, 1 Jul 2024 12:00:07 +0530 Subject: [PATCH 4/4] remove redundant code Signed-off-by: rohitthakur2590 --- changelogs/fragments/fix_f5_remote_addr_mapping.yaml | 2 +- plugins/connection/persistent.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/changelogs/fragments/fix_f5_remote_addr_mapping.yaml b/changelogs/fragments/fix_f5_remote_addr_mapping.yaml index f39d446d6..0e94534ed 100644 --- a/changelogs/fragments/fix_f5_remote_addr_mapping.yaml +++ b/changelogs/fragments/fix_f5_remote_addr_mapping.yaml @@ -1,3 +1,3 @@ --- bugfixes: - - Correctly supply the provided variables(remote server,host,port) addr as part of options to persistent connection. + - Properly pass the provided variables (remote server, host, port) as options to the persistent connection. diff --git a/plugins/connection/persistent.py b/plugins/connection/persistent.py index c9767872e..72983dc48 100644 --- a/plugins/connection/persistent.py +++ b/plugins/connection/persistent.py @@ -73,7 +73,6 @@ def run(self): host=self._play_context.remote_addr, ) options = self.get_options() - options["ansible_command_timeout"] = self.get_option("persistent_command_timeout") for option in self._options.keys(): options[option] = self.get_option(option) socket_path = start_connection(self._play_context, options, self._task_uuid)