mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Move complex_args templating to be with module_args
Keeps every action plugin from having to do the same thing.
This commit is contained in:
@@ -36,10 +36,8 @@ class ActionModule(object):
|
||||
if complex_args:
|
||||
options.update(complex_args)
|
||||
options.update(utils.parse_kv(module_args))
|
||||
options = utils.template(self.runner.basedir, options, inject)
|
||||
source = options.get('src', None)
|
||||
dest = options.get('dest', None)
|
||||
module_args = self.runner._complex_args_hack(options, '')
|
||||
|
||||
if (source is None and not 'first_available_file' in inject) or dest is None:
|
||||
result=dict(failed=True, msg="src and dest are required")
|
||||
|
||||
@@ -36,7 +36,6 @@ class ActionModule(object):
|
||||
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:
|
||||
|
||||
@@ -41,8 +41,6 @@ class ActionModule(object):
|
||||
if complex_args:
|
||||
options.update(complex_args)
|
||||
options.update(utils.parse_kv(module_args))
|
||||
options = utils.template(self.runner.basedir, options, inject)
|
||||
module_args = self.runner._complex_args_hack(options, '')
|
||||
|
||||
source = options.get('src', None)
|
||||
dest = options.get('dest', None)
|
||||
|
||||
Reference in New Issue
Block a user