diff --git a/changelogs/fragments/62407-wait_for_connection.yml b/changelogs/fragments/62407-wait_for_connection.yml new file mode 100644 index 00000000000..32a3daf4fbe --- /dev/null +++ b/changelogs/fragments/62407-wait_for_connection.yml @@ -0,0 +1,2 @@ +bugfixes: +- Remove a temp directory created by wait_for_connection action plugin (https://github.com/ansible/ansible/issues/62407). diff --git a/lib/ansible/plugins/action/wait_for_connection.py b/lib/ansible/plugins/action/wait_for_connection.py index a8591b13dcf..fbf4e98fa27 100644 --- a/lib/ansible/plugins/action/wait_for_connection.py +++ b/lib/ansible/plugins/action/wait_for_connection.py @@ -115,4 +115,7 @@ class ActionModule(ActionBase): elapsed = datetime.now() - start result['elapsed'] = elapsed.seconds + # remove a temporary path we created + self._remove_tmp_path(self._connection._shell.tmpdir) + return result