mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Fixing issues with httpapi (#40388)
* I seem to have forgotten the back half of tests * Set http timeout from persistent_command_timeout * Tweak URL generation and provide URL on error * Push var_options to connection process * Don't wait forever if coming from persistent * Don't send the entire contents of variables to ansible-connection
This commit is contained in:
parent
231c3586bd
commit
483df13626
61 changed files with 46 additions and 390 deletions
|
@ -813,7 +813,9 @@ class TaskExecutor:
|
|||
self._play_context.timeout = connection.get_option('persistent_command_timeout')
|
||||
display.vvvv('attempting to start connection', host=self._play_context.remote_addr)
|
||||
display.vvvv('using connection plugin %s' % connection.transport, host=self._play_context.remote_addr)
|
||||
socket_path = self._start_connection()
|
||||
# We don't need to send the entire contents of variables to ansible-connection
|
||||
filtered_vars = dict((key, value) for key, value in variables.items() if key.startswith('ansible'))
|
||||
socket_path = self._start_connection(filtered_vars)
|
||||
display.vvvv('local domain socket path is %s' % socket_path, host=self._play_context.remote_addr)
|
||||
setattr(connection, '_socket_path', socket_path)
|
||||
|
||||
|
@ -886,7 +888,7 @@ class TaskExecutor:
|
|||
|
||||
return handler
|
||||
|
||||
def _start_connection(self):
|
||||
def _start_connection(self, variables):
|
||||
'''
|
||||
Starts the persistent connection
|
||||
'''
|
||||
|
@ -918,8 +920,12 @@ class TaskExecutor:
|
|||
# that means only protocol=0 will work.
|
||||
src = cPickle.dumps(self._play_context.serialize(), protocol=0)
|
||||
stdin.write(src)
|
||||
|
||||
stdin.write(b'\n#END_INIT#\n')
|
||||
|
||||
src = cPickle.dumps(variables, protocol=0)
|
||||
stdin.write(src)
|
||||
stdin.write(b'\n#END_VARS#\n')
|
||||
|
||||
stdin.flush()
|
||||
|
||||
(stdout, stderr) = p.communicate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue