From 8d73945468ab9aa324ab5d74e123019df88fcef9 Mon Sep 17 00:00:00 2001 From: Dmitry Sukhodoev Date: Sat, 24 Aug 2024 19:52:49 +0500 Subject: [PATCH] reset multiplexer only at connection failure --- lib/ansible/plugins/action/wait_for_connection.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ansible/plugins/action/wait_for_connection.py b/lib/ansible/plugins/action/wait_for_connection.py index 9eb3fac975e..a74083e9b20 100644 --- a/lib/ansible/plugins/action/wait_for_connection.py +++ b/lib/ansible/plugins/action/wait_for_connection.py @@ -81,16 +81,16 @@ class ActionModule(ActionBase): # 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() - except AttributeError: - pass ping_result = self._execute_module(module_name='ansible.legacy.ping', module_args=dict(), task_vars=task_vars) # Test module output if ping_result['ping'] != 'pong': + # call connection reset between runs if it's there + try: + self._connection.reset() + except AttributeError: + pass raise Exception('ping test failed') start = datetime.now()