Merge pull request #9973 from shanemcd/fix-adhoc-commands

Fix issue where ad-hoc commands for multiple hosts ran on single host

Should resolve #9685

Reviewed-by: Matthew Jones <bsdmatburt@gmail.com>
This commit is contained in:
softwarefactory-project-zuul[bot] 2021-04-21 17:17:36 +00:00 committed by GitHub
commit eec4f8dcc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2753,14 +2753,6 @@ class RunAdHocCommand(BaseTask):
env['ANSIBLE_LOAD_CALLBACK_PLUGINS'] = '1'
env['ANSIBLE_SFTP_BATCH_MODE'] = 'False'
# Create a directory for ControlPath sockets that is unique to each
# ad hoc command
cp_dir = os.path.join(private_data_dir, 'cp')
if not os.path.exists(cp_dir):
os.mkdir(cp_dir, 0o700)
# FIXME: more elegant way to manage this path in container
env['ANSIBLE_SSH_CONTROL_PATH'] = '/runner/cp'
return env
def build_args(self, ad_hoc_command, private_data_dir, passwords):