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
7e10a7fe
Commit
7e10a7fe
authored
Feb 17, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6038 from mmoya/docfix
Doc improvements / fixes
parents
1544c93b
a2816435
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
docsite/build-site.py
+1
-1
docsite/rst/playbooks_variables.rst
+11
-8
No files found.
docsite/build-site.py
View file @
7e10a7fe
...
@@ -99,5 +99,5 @@ if __name__ == '__main__':
...
@@ -99,5 +99,5 @@ if __name__ == '__main__':
if
"view"
in
sys
.
argv
:
if
"view"
in
sys
.
argv
:
import
webbrowser
import
webbrowser
if
not
webbrowser
.
open
(
'index.html'
):
if
not
webbrowser
.
open
(
'
htmlout/
index.html'
):
print
>>
sys
.
stderr
,
"Could not open on your webbrowser."
print
>>
sys
.
stderr
,
"Could not open on your webbrowser."
docsite/rst/playbooks_variables.rst
View file @
7e10a7fe
...
@@ -113,9 +113,9 @@ Jinja2 Filters
...
@@ -113,9 +113,9 @@ Jinja2 Filters
.. note:: These are infrequently utilized features. Use them if they fit a use case you have, but this is optional knowledge.
.. note:: These are infrequently utilized features. Use them if they fit a use case you have, but this is optional knowledge.
Filters in Jinja2 are a way of transforming template expressions from one kind of data into another. Jinja2
Filters in Jinja2 are a way of transforming template expressions from one kind of data into another. Jinja2
ships with many of these
as documented o
n the official Jinja2 template documentation.
ships with many of these
. See `builtin filters`_ i
n the official Jinja2 template documentation.
In addition to th
ese, Ansible supplies many more.
In addition to th
ose, Ansible supplies many more.
.. _filters_for_formatting_data:
.. _filters_for_formatting_data:
...
@@ -172,7 +172,7 @@ The variable value will be used as is, but the template evaluation will raise an
...
@@ -172,7 +172,7 @@ The variable value will be used as is, but the template evaluation will raise an
Defaulting Undefined Variables
Defaulting Undefined Variables
------------------------------
------------------------------
Jinja2 provides a useful 'default
s
' filter, that is often a better approach to failing if a variable is not defined.
Jinja2 provides a useful 'default' filter, that is often a better approach to failing if a variable is not defined.
{{ some_variable | default(5) }}
{{ some_variable | default(5) }}
...
@@ -189,7 +189,7 @@ All these functions return a unique set from sets or lists.
...
@@ -189,7 +189,7 @@ All these functions return a unique set from sets or lists.
To get a unique set from a list::
To get a unique set from a list::
{{ list1 |unique }}
{{ list1 |
unique }}
To get a union of two lists::
To get a union of two lists::
...
@@ -197,15 +197,15 @@ To get a union of two lists::
...
@@ -197,15 +197,15 @@ To get a union of two lists::
To get the intersection of 2 lists (unique list of all items in both)::
To get the intersection of 2 lists (unique list of all items in both)::
{{ list1 |
intersect(list2)
}}
{{ list1 |
intersect(list2)
}}
To get the difference of 2 lists (items in 1 that don't exist in 2)::
To get the difference of 2 lists (items in 1 that don't exist in 2)::
{{ list1 |
difference(list2)
}}
{{ list1 |
difference(list2)
}}
To get the symmetric difference of 2 lists (items exclusive to each list)::
To get the symmetric difference of 2 lists (items exclusive to each list)::
{{ list1 |
symmetric_difference(list2)
}}
{{ list1 |
symmetric_difference(list2)
}}
.. _other_useful_filters:
.. _other_useful_filters:
...
@@ -925,9 +925,12 @@ So, that's precedence, explained in a more direct way. Don't worry about preced
...
@@ -925,9 +925,12 @@ So, that's precedence, explained in a more direct way. Don't worry about preced
variable that is a default, or a "live" variable you definitely want to use. Inventory lies in precedence right in the middle, and
variable that is a default, or a "live" variable you definitely want to use. Inventory lies in precedence right in the middle, and
if you want to forcibly override something, use -e.
if you want to forcibly override something, use -e.
If you found that a little hard to understand, take a look at the
"ansible-examples"
repo on our github for a bit more about
If you found that a little hard to understand, take a look at the
`ansible-examples`_
repo on our github for a bit more about
how all of these things can work together.
how all of these things can work together.
.. _ansible-examples: https://github.com/ansible/ansible-examples
.. _builtin filters: http://jinja.pocoo.org/docs/templates/#builtin-filters
.. seealso::
.. seealso::
:doc:`playbooks`
:doc:`playbooks`
...
...
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