mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -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
|
@ -44,9 +44,9 @@ class ActionModule(object):
|
|||
return ReturnData(conn=conn, result=results)
|
||||
|
||||
# apply templating to source argument
|
||||
source = utils.template(source, inject)
|
||||
source = utils.template(self.runner.basedir, source, inject)
|
||||
# apply templating to dest argument
|
||||
dest = utils.template(dest, inject)
|
||||
dest = utils.template(self.runner.basedir, 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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue