mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
Disable ControlPersist for ad hoc commands, should avoid any issues with proot or needing to clean up sockets afterwards.
This commit is contained in:
parent
3f8ab73733
commit
8beed7f409
@ -1209,12 +1209,9 @@ class RunAdHocCommand(BaseTask):
|
|||||||
elif settings.DEBUG:
|
elif settings.DEBUG:
|
||||||
env['JOB_CALLBACK_DEBUG'] = '1'
|
env['JOB_CALLBACK_DEBUG'] = '1'
|
||||||
|
|
||||||
# Create a directory for ControlPath sockets that is unique to each
|
# Specify empty SSH args (should disable ControlPersist entirely for
|
||||||
# ad hoc command and visible inside the proot environment (when enabled).
|
# ad hoc commands).
|
||||||
cp_dir = os.path.join(kwargs['private_data_dir'], 'cp')
|
env.setdefault('ANSIBLE_SSH_ARGS', '')
|
||||||
if not os.path.exists(cp_dir):
|
|
||||||
os.mkdir(cp_dir, 0700)
|
|
||||||
env['ANSIBLE_SSH_CONTROL_PATH'] = os.path.join(cp_dir, 'ansible-ssh-%%h-%%p-%%r')
|
|
||||||
|
|
||||||
return env
|
return env
|
||||||
|
|
||||||
|
@ -458,8 +458,6 @@ class AdHocCommandCallbackModule(BaseCallbackModule):
|
|||||||
Callback module for logging ansible ad hoc events via ZMQ or the REST API.
|
Callback module for logging ansible ad hoc events via ZMQ or the REST API.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
# FIXME: Clean up lingering control persist sockets.
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ad_hoc_command_id = int(os.getenv('AD_HOC_COMMAND_ID', '0'))
|
self.ad_hoc_command_id = int(os.getenv('AD_HOC_COMMAND_ID', '0'))
|
||||||
self.rest_api_path = '/api/v1/ad_hoc_commands/%d/events/' % self.ad_hoc_command_id
|
self.rest_api_path = '/api/v1/ad_hoc_commands/%d/events/' % self.ad_hoc_command_id
|
||||||
|
Loading…
Reference in New Issue
Block a user