mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-08 09:24:01 -07:00
Ensure complex_args is considered in all action_plugins
This commit is contained in:
parent
297259725a
commit
ae8d6ac303
10 changed files with 39 additions and 14 deletions
|
@ -37,7 +37,10 @@ class ActionModule(object):
|
|||
raise errors.AnsibleError("in current versions of ansible, templates are only usable in playbooks")
|
||||
|
||||
# load up options
|
||||
options = utils.parse_kv(module_args)
|
||||
options = {}
|
||||
if complex_args:
|
||||
options.update(complex_args)
|
||||
options.update(utils.parse_kv(module_args))
|
||||
source = options.get('src', None)
|
||||
dest = options.get('dest', None)
|
||||
|
||||
|
@ -106,9 +109,9 @@ class ActionModule(object):
|
|||
if self.runner.check:
|
||||
return ReturnData(conn=conn, comm_ok=True, result=dict(changed=True), diff=dict(before_header=dest, after_header=source, before=dest_contents, after=resultant))
|
||||
else:
|
||||
res = self.runner._execute_module(conn, tmp, 'copy', module_args, inject=inject)
|
||||
res = self.runner._execute_module(conn, tmp, 'copy', module_args, inject=inject, complex_args=complex_args)
|
||||
res.diff = dict(before=dest_contents, after=resultant)
|
||||
return res
|
||||
else:
|
||||
return self.runner._execute_module(conn, tmp, 'file', module_args, inject=inject)
|
||||
return self.runner._execute_module(conn, tmp, 'file', module_args, inject=inject, complex_args=complex_args)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue