|
|
@ -435,7 +435,6 @@ class Runner(object):
|
|
|
|
# will be unneccessary as it can decide to daisychain via it's own module returns.
|
|
|
|
# will be unneccessary as it can decide to daisychain via it's own module returns.
|
|
|
|
# and this function can be deleted.
|
|
|
|
# and this function can be deleted.
|
|
|
|
|
|
|
|
|
|
|
|
options = utils.parse_kv(self.module_args)
|
|
|
|
|
|
|
|
return self._execute_module(conn, tmp, 'assemble', self.module_args, inject=inject).daisychain('file')
|
|
|
|
return self._execute_module(conn, tmp, 'assemble', self.module_args, inject=inject).daisychain('file')
|
|
|
|
|
|
|
|
|
|
|
|
# *****************************************************
|
|
|
|
# *****************************************************
|
|
|
@ -516,7 +515,7 @@ class Runner(object):
|
|
|
|
|
|
|
|
|
|
|
|
# *****************************************************
|
|
|
|
# *****************************************************
|
|
|
|
|
|
|
|
|
|
|
|
def _executor_internal_inner(self, host, inject, port):
|
|
|
|
def _executor_internal_inner(self, host, inject, port, is_chained=False):
|
|
|
|
''' decides how to invoke a module '''
|
|
|
|
''' decides how to invoke a module '''
|
|
|
|
|
|
|
|
|
|
|
|
# special non-user/non-fact variables:
|
|
|
|
# special non-user/non-fact variables:
|
|
|
@ -564,19 +563,24 @@ class Runner(object):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
result = self._execute_async_module(conn, tmp, module_name, inject=inject)
|
|
|
|
result = self._execute_async_module(conn, tmp, module_name, inject=inject)
|
|
|
|
|
|
|
|
|
|
|
|
chained = False
|
|
|
|
result.result['module'] = self.module_name
|
|
|
|
if result.is_successful() and 'daisychain' in result.result:
|
|
|
|
if result.is_successful() and 'daisychain' in result.result:
|
|
|
|
chained = True
|
|
|
|
|
|
|
|
self.module_name = result.result['daisychain']
|
|
|
|
self.module_name = result.result['daisychain']
|
|
|
|
if 'daisychain_args' in result.result:
|
|
|
|
if 'daisychain_args' in result.result:
|
|
|
|
self.module_args = result.result['daisychain_args']
|
|
|
|
self.module_args = result.result['daisychain_args']
|
|
|
|
result2 = self._executor_internal_inner(host, inject, port)
|
|
|
|
result2 = self._executor_internal_inner(host, inject, port, is_chained=True)
|
|
|
|
|
|
|
|
result2.result['module'] = self.module_name
|
|
|
|
changed = False
|
|
|
|
changed = False
|
|
|
|
|
|
|
|
# print "result1=%s" % result.result
|
|
|
|
|
|
|
|
# print "result2=%s" % result2.result
|
|
|
|
if result.result.get('changed',False) or result2.result.get('changed',False):
|
|
|
|
if result.result.get('changed',False) or result2.result.get('changed',False):
|
|
|
|
changed = True
|
|
|
|
changed = True
|
|
|
|
result.result.update(result2.result)
|
|
|
|
# print "DEBUG=%s" % changed
|
|
|
|
result.result['changed'] = changed
|
|
|
|
result2.result.update(result.result)
|
|
|
|
|
|
|
|
result2.result['changed'] = changed
|
|
|
|
|
|
|
|
result = result2
|
|
|
|
del result.result['daisychain']
|
|
|
|
del result.result['daisychain']
|
|
|
|
|
|
|
|
# print "DEBUG2=%s" % result.result['changed']
|
|
|
|
|
|
|
|
|
|
|
|
self._delete_remote_files(conn, tmp)
|
|
|
|
self._delete_remote_files(conn, tmp)
|
|
|
|
conn.close()
|
|
|
|
conn.close()
|
|
|
@ -588,7 +592,9 @@ class Runner(object):
|
|
|
|
data = result.result
|
|
|
|
data = result.result
|
|
|
|
if 'item' in inject:
|
|
|
|
if 'item' in inject:
|
|
|
|
result.result['item'] = inject['item']
|
|
|
|
result.result['item'] = inject['item']
|
|
|
|
if not chained:
|
|
|
|
if is_chained:
|
|
|
|
|
|
|
|
# no callbacks
|
|
|
|
|
|
|
|
return result
|
|
|
|
if 'skipped' in data:
|
|
|
|
if 'skipped' in data:
|
|
|
|
self.callbacks.on_skipped(result.host)
|
|
|
|
self.callbacks.on_skipped(result.host)
|
|
|
|
elif not result.is_successful():
|
|
|
|
elif not result.is_successful():
|
|
|
|