mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-05 16:04:09 -07:00
Allow including files through variables
$FILE{file} will be replaced with the contents of "file" $PIPE{cat file} will be replaced with the output of "cat file"
This commit is contained in:
parent
b8c4bb9e6e
commit
cc948f339c
9 changed files with 79 additions and 29 deletions
|
@ -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(fn, inject)
|
||||
fn = utils.template(self.runner.basedir, 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(source, inject)
|
||||
source = utils.template(self.runner.basedir, source, inject)
|
||||
source = utils.path_dwim(self.runner.basedir, source)
|
||||
|
||||
local_md5 = utils.md5(source)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue