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
ec16b854
Commit
ec16b854
authored
Feb 17, 2013
by
Lorin Hochstein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document new PIPE_ONCE macro
parent
cd32597a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
docsite/rst/playbooks2.rst
+12
-0
No files found.
docsite/rst/playbooks2.rst
View file @
ec16b854
...
...
@@ -583,6 +583,18 @@ is an example using the authorized_key module, which requires the actual text of
The "$PIPE" macro works just like file, except you would feed it a command string instead. It executes locally, not remotely, as does $FILE.
Because Ansible uses lazy evaluation, a "$PIPE" macro will be executed each time it is used. For
example, it will be executed separately for each host, and if it is used in a variable definition,
it will be executed each time the variable is evaluated.
The "$PIPE_ONCE" macro is an alternative that uses a caching strategy: it is executed only once, and
subsequent accesses use the cached value. One use case is for computing a timestamp that is intended
to be the same across all tasks and hosts that use it::
vars:
timestamp: $PIPE_ONCE(date +%Y%m%d-%H%M%S)
Selecting Files And Templates Based On Variables
````````````````````````````````````````````````
...
...
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