mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Revert "Allow including files through variables"
This reverts commit bf47bb4753
.
Conflicts:
lib/ansible/utils.py
test/TestUtils.py
This commit is contained in:
parent
1bd9ea6440
commit
b8c4bb9e6e
9 changed files with 30 additions and 80 deletions
|
@ -200,7 +200,7 @@ class Runner(object):
|
|||
|
||||
cmd = ""
|
||||
if not is_new_style:
|
||||
args = utils.template(self.basedir, args, inject)
|
||||
args = utils.template(args, inject)
|
||||
argsfile = self._transfer_str(conn, tmp, 'arguments', args)
|
||||
if async_jid is None:
|
||||
cmd = "%s %s" % (remote_module_path, argsfile)
|
||||
|
@ -258,7 +258,7 @@ class Runner(object):
|
|||
|
||||
items = self.module_vars.get('items', [])
|
||||
if isinstance(items, basestring) and items.startswith("$"):
|
||||
items = utils.varLookup(self.basedir, items, inject)
|
||||
items = utils.varLookup(items, inject)
|
||||
if type(items) != list:
|
||||
raise errors.AnsibleError("with_items only takes a list: %s" % items)
|
||||
|
||||
|
@ -327,13 +327,13 @@ class Runner(object):
|
|||
for (k,v) in self.module_args.iteritems():
|
||||
new_args = new_args + "%s='%s' " % (k,v)
|
||||
self.module_args = new_args
|
||||
self.module_args = utils.template(self.basedir, self.module_args, inject)
|
||||
self.module_args = utils.template(self.module_args, inject)
|
||||
|
||||
def _check_conditional(conditional):
|
||||
def is_set(var):
|
||||
return not var.startswith("$")
|
||||
return eval(conditional)
|
||||
conditional = utils.template(self.basedir, self.conditional, inject)
|
||||
conditional = utils.template(self.conditional, inject)
|
||||
if not _check_conditional(conditional):
|
||||
result = utils.jsonify(dict(skipped=True))
|
||||
self.callbacks.on_skipped(host, inject.get('item',None))
|
||||
|
@ -352,7 +352,7 @@ class Runner(object):
|
|||
result = dict(failed=True, msg="FAILED: %s" % str(e))
|
||||
return ReturnData(host=host, comm_ok=False, result=result)
|
||||
|
||||
module_name = utils.template(self.basedir, self.module_name, inject)
|
||||
module_name = utils.template(self.module_name, inject)
|
||||
|
||||
tmp = ''
|
||||
if self.module_name != 'raw':
|
||||
|
@ -499,7 +499,7 @@ class Runner(object):
|
|||
if module_common.REPLACER in module_data:
|
||||
is_new_style=True
|
||||
module_data = module_data.replace(module_common.REPLACER, module_common.MODULE_COMMON)
|
||||
encoded_args = "\"\"\"%s\"\"\"" % utils.template(self.basedir, self.module_args, inject).replace("\"","\\\"")
|
||||
encoded_args = "\"\"\"%s\"\"\"" % utils.template(self.module_args, inject).replace("\"","\\\"")
|
||||
module_data = module_data.replace(module_common.REPLACER_ARGS, encoded_args)
|
||||
|
||||
# use the correct python interpreter for the host
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue