mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Revert "Allow including files through variables"
This reverts commit bf47bb4753.
Conflicts:
lib/ansible/utils.py
test/TestUtils.py
This commit is contained in:
@@ -48,7 +48,7 @@ class ActionModule(object):
|
||||
if 'first_available_file' in inject:
|
||||
found = False
|
||||
for fn in inject.get('first_available_file'):
|
||||
fn = utils.template(self.runner.basedir, fn, inject)
|
||||
fn = utils.template(fn, inject)
|
||||
if os.path.exists(fn):
|
||||
source = fn
|
||||
found = True
|
||||
@@ -57,7 +57,7 @@ class ActionModule(object):
|
||||
results=dict(failed=True, msg="could not find src in first_available_file list")
|
||||
return ReturnData(conn=conn, results=results)
|
||||
|
||||
source = utils.template(self.runner.basedir, source, inject)
|
||||
source = utils.template(source, inject)
|
||||
source = utils.path_dwim(self.runner.basedir, source)
|
||||
|
||||
local_md5 = utils.md5(source)
|
||||
|
||||
@@ -44,9 +44,9 @@ class ActionModule(object):
|
||||
return ReturnData(conn=conn, result=results)
|
||||
|
||||
# apply templating to source argument
|
||||
source = utils.template(self.runner.basedir, source, inject)
|
||||
source = utils.template(source, inject)
|
||||
# apply templating to dest argument
|
||||
dest = utils.template(self.runner.basedir, dest, inject)
|
||||
dest = utils.template(dest, inject)
|
||||
|
||||
# files are saved in dest dir, with a subdir for each host, then the filename
|
||||
dest = "%s/%s/%s" % (utils.path_dwim(self.runner.basedir, dest), conn.host, source)
|
||||
|
||||
@@ -51,7 +51,7 @@ class ActionModule(object):
|
||||
if 'first_available_file' in inject:
|
||||
found = False
|
||||
for fn in self.runner.module_vars.get('first_available_file'):
|
||||
fn = utils.template(self.runner.basedir, fn, inject)
|
||||
fn = utils.template(fn, inject)
|
||||
if os.path.exists(fn):
|
||||
source = fn
|
||||
found = True
|
||||
@@ -60,7 +60,7 @@ class ActionModule(object):
|
||||
result = dict(failed=True, msg="could not find src in first_available_file list")
|
||||
return ReturnData(conn=conn, comm_ok=False, result=result)
|
||||
|
||||
source = utils.template(self.runner.basedir, source, inject)
|
||||
source = utils.template(source, inject)
|
||||
|
||||
# template the source data locally & transfer
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user