diff --git a/bin/ansible-connection b/bin/ansible-connection index 09656a55415..ac378a4d872 100755 --- a/bin/ansible-connection +++ b/bin/ansible-connection @@ -271,6 +271,8 @@ def main(): if rc == 0: process.run() + else: + process.shutdown() sys.exit(rc) diff --git a/changelogs/fragments/ansible-connection-cleanup-when-failed.yaml b/changelogs/fragments/ansible-connection-cleanup-when-failed.yaml new file mode 100644 index 00000000000..e57839d1fa7 --- /dev/null +++ b/changelogs/fragments/ansible-connection-cleanup-when-failed.yaml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-connection - Clean up socket files if playbook aborted before connection is started.