Working on complex argument support.

This commit is contained in:
Michael DeHaan 2013-02-17 15:01:49 -05:00
parent 5a91873983
commit 1ecf4a6943
18 changed files with 85 additions and 27 deletions

View file

@ -33,9 +33,12 @@ class ActionModule(object):
def __init__(self, runner):
self.runner = runner
def run(self, conn, tmp, module_name, module_args, inject):
def run(self, conn, tmp, module_name, module_args, inject, complex_args=None, **kwargs):
''' transfer & execute a module that is not 'copy' or 'template' '''
complex_args = utils.template(self.runner.basedir, complex_args, inject)
module_args = self.runner._complex_args_hack(complex_args, module_args)
if self.runner.check:
if module_name in [ 'shell', 'command' ]:
return ReturnData(conn=conn, comm_ok=True, result=dict(skipped=True, msg='check mode not supported for %s' % module_name))
@ -49,6 +52,6 @@ class ActionModule(object):
module_args += " #USE_SHELL"
vv("REMOTE_MODULE %s %s" % (module_name, module_args), host=conn.host)
return self.runner._execute_module(conn, tmp, module_name, module_args, inject=inject)
return self.runner._execute_module(conn, tmp, module_name, module_args, inject=inject, complex_args=complex_args)