From f6a10b56336e116f81a86149d918b447e4eaaca3 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Tue, 12 Nov 2019 23:54:52 +0530 Subject: [PATCH] [2.9] Remove temp directory created by wait_for_connection (#64738) wait_for_connection creates AnsiballZ_ping.py in temp directory, which remains on remote machine even after playbook run. Fixes: #62407 Signed-off-by: Abhijeet Kasurde (cherry picked from commit 68428efc39313b7fb22b77152ec548ca983b03dd) --- changelogs/fragments/62407-wait_for_connection.yml | 2 ++ lib/ansible/plugins/action/wait_for_connection.py | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/62407-wait_for_connection.yml 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 f085e661f9f..7686f2f64aa 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