From aa645190720f2a0cb26aebf66909c0d3d5ee25d7 Mon Sep 17 00:00:00 2001 From: James Cassell Date: Mon, 10 Feb 2020 18:32:31 -0500 Subject: [PATCH] wait_for_connection: also retry interpreter discovery (#67040) (#67136) self._discovered_interpreter_key is None unless a previous iteration has attempted discovery. In that case, force re-discovery, as the previous attempt certainly failed. (cherry picked from commit fd954a9c5c05c7149eb23271529ff070f2b1f9dc) --- .../wait_for_connection-interpreter-discovery-retry.yaml | 4 ++++ lib/ansible/plugins/action/wait_for_connection.py | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 changelogs/fragments/wait_for_connection-interpreter-discovery-retry.yaml diff --git a/changelogs/fragments/wait_for_connection-interpreter-discovery-retry.yaml b/changelogs/fragments/wait_for_connection-interpreter-discovery-retry.yaml new file mode 100644 index 00000000000..446edd24f1f --- /dev/null +++ b/changelogs/fragments/wait_for_connection-interpreter-discovery-retry.yaml @@ -0,0 +1,4 @@ +--- +bugfixes: +- wait_for_connection - with pipelining enabled, interpreter discovery would + fail if the first connection attempt was not successful diff --git a/lib/ansible/plugins/action/wait_for_connection.py b/lib/ansible/plugins/action/wait_for_connection.py index 7686f2f64aa..357f8331ba2 100644 --- a/lib/ansible/plugins/action/wait_for_connection.py +++ b/lib/ansible/plugins/action/wait_for_connection.py @@ -79,6 +79,9 @@ class ActionModule(ActionBase): def ping_module_test(connect_timeout): ''' Test ping module, if available ''' display.vvv("wait_for_connection: attempting ping module test") + # re-run interpreter discovery if we ran it in the first iteration + if self._discovered_interpreter_key: + task_vars['ansible_facts'].pop(self._discovered_interpreter_key, None) # call connection reset between runs if it's there try: self._connection.reset()