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
1867fb48
Commit
1867fb48
authored
Jul 19, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update an example.
parent
10bc6f6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
docsite/latest/rst/playbooks2.rst
+7
-6
No files found.
docsite/latest/rst/playbooks2.rst
View file @
1867fb48
...
...
@@ -800,10 +800,11 @@ The 'register' keyword decides what variable to save a result in. The resulting
- shell: echo "motd contains the word hi"
when: motd_contents.stdout.find('hi') != -1
As shown previously, the registered variable's string contents are accessible with the 'stdout'
method
.
As shown previously, the registered variable's string contents are accessible with the 'stdout'
value
.
The registered result can be used in the "with_items" of a task if it is converted into
a list (or already is a list) as shown below in another trivial example::
a list (or already is a list) as shown below. "stdout_lines" is already available on the object as
well though you could also call "home_dirs.stdout.split()" if you wanted, and could split by other
fields::
- name: registered variable usage as a with_items list
hosts: all
...
...
@@ -815,9 +816,9 @@ a list (or already is a list) as shown below in another trivial example::
register: home_dirs
- name: add home dirs to the backup spooler
file: path=/mnt/bkspool/{{
item
}} src=/home/{{ item }} state=link
with_items: home_dirs.stdout
.split()
file: path=/mnt/bkspool/{{
item
}} src=/home/{{ item }} state=link
with_items: home_dirs.stdout
_lines
# with_items: home_dirs.stdout.split()
Rolling Updates
```````````````
...
...
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