Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
435905de
Commit
435905de
authored
Jan 04, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1826 from willthames/new_template_variables
Added additional template variables
parents
caee51e9
411b2bf7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
lib/ansible/utils/template.py
+2
-0
library/template
+4
-3
No files found.
lib/ansible/utils/template.py
View file @
435905de
...
...
@@ -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
(
...
...
library/template
View file @
435905de
...
...
@@ -9,12 +9,13 @@ description:
(U(http://jinja.pocoo.org/docs/)) - documentation on the template
formatting can be found in the Template Designer Documentation
(U(http://jinja.pocoo.org/docs/templates/)).
- "
Four
additional variables can be used in templates: C(ansible_managed)
- "
Six
additional variables can be used in templates: C(ansible_managed)
(configurable via the C(defaults) section of C(ansible.cfg)) contains a string
which can be used to describe the template name, host, modification time of the
template file and the owner uid, C(template_host) contains the node name of
the template's machine, C(template_uid) the owner, and C(template_path) the
file name."
the template's machine, C(template_uid) the owner, C(template_path) the
relative path of the template, C(template_fullpath) is the absolute path of the
template, and C(template_run_date) is the date that the template was rendered."
options:
src:
description:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment