mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
Added additional template variables
Added two additional template variables * template_fullpath - absolute path to the template * template_run_date - date that the template was rendered Documented these additional variables in the module documentation
This commit is contained in:
parent
caee51e90e
commit
411b2bf7d9
2 changed files with 6 additions and 3 deletions
|
@ -303,6 +303,8 @@ def template_from_file(basedir, path, vars):
|
|||
vars['template_path'] = realpath
|
||||
vars['template_mtime'] = datetime.datetime.fromtimestamp(os.path.getmtime(realpath))
|
||||
vars['template_uid'] = template_uid
|
||||
vars['template_fullpath'] = os.path.abspath(realpath)
|
||||
vars['template_run_date'] = datetime.datetime.now()
|
||||
|
||||
managed_default = C.DEFAULT_MANAGED_STR
|
||||
managed_str = managed_default.format(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue