|
|
|
@ -690,7 +690,7 @@ def _find_module_utils(module_name, b_module_data, module_path, module_args, tas
|
|
|
|
|
|
|
|
|
|
zf.writestr('ansible_module_%s.py' % module_name, b_module_data)
|
|
|
|
|
|
|
|
|
|
py_module_cache = { ('__init__',): (b'', '[builtin]') }
|
|
|
|
|
py_module_cache = {('__init__',): (b'', '[builtin]')}
|
|
|
|
|
recursive_finder(module_name, b_module_data, py_module_names, py_module_cache, zf)
|
|
|
|
|
zf.close()
|
|
|
|
|
zipdata = base64.b64encode(zipoutput.getvalue())
|
|
|
|
@ -721,8 +721,8 @@ def _find_module_utils(module_name, b_module_data, module_path, module_args, tas
|
|
|
|
|
try:
|
|
|
|
|
zipdata = open(cached_module_filename, 'rb').read()
|
|
|
|
|
except IOError:
|
|
|
|
|
raise AnsibleError('A different worker process failed to create module file.'
|
|
|
|
|
' Look at traceback for that process for debugging information.')
|
|
|
|
|
raise AnsibleError('A different worker process failed to create module file. '
|
|
|
|
|
'Look at traceback for that process for debugging information.')
|
|
|
|
|
zipdata = to_text(zipdata, errors='surrogate_or_strict')
|
|
|
|
|
|
|
|
|
|
shebang, interpreter = _get_shebang(u'/usr/bin/python', task_vars)
|
|
|
|
@ -734,7 +734,7 @@ def _find_module_utils(module_name, b_module_data, module_path, module_args, tas
|
|
|
|
|
interpreter_parts = interpreter.split(u' ')
|
|
|
|
|
interpreter = u"'{0}'".format(u"', '".join(interpreter_parts))
|
|
|
|
|
|
|
|
|
|
now=datetime.datetime.utcnow()
|
|
|
|
|
now = datetime.datetime.utcnow()
|
|
|
|
|
output.write(to_bytes(ACTIVE_ANSIBALLZ_TEMPLATE % dict(
|
|
|
|
|
zipdata=zipdata,
|
|
|
|
|
ansible_module=module_name,
|
|
|
|
@ -837,6 +837,7 @@ def modify_module(module_name, module_path, module_args, task_vars=dict(), modul
|
|
|
|
|
|
|
|
|
|
return (b_module_data, module_style, to_text(shebang, nonstring='passthru'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def build_windows_module_payload(module_name, module_path, b_module_data, module_args, task_vars, task, play_context, environment):
|
|
|
|
|
exec_manifest = dict(
|
|
|
|
|
module_entry=to_text(base64.b64encode(b_module_data)),
|
|
|
|
@ -856,7 +857,7 @@ def build_windows_module_payload(module_name, module_path, b_module_data, module
|
|
|
|
|
exec_manifest["async_jid"] = str(random.randint(0, 999999999999))
|
|
|
|
|
exec_manifest["async_timeout_sec"] = task.async
|
|
|
|
|
|
|
|
|
|
if play_context.become and play_context.become_method=='runas':
|
|
|
|
|
if play_context.become and play_context.become_method == 'runas':
|
|
|
|
|
exec_manifest["actions"].insert(0, 'become')
|
|
|
|
|
exec_manifest["become_user"] = play_context.become_user
|
|
|
|
|
exec_manifest["become_password"] = play_context.become_pass
|
|
|
|
|