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
feb4a884
Commit
feb4a884
authored
Jul 21, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slight edit to when_changed docs
parent
b603bb0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
17 deletions
+14
-17
docsite/latest/rst/playbooks2.rst
+14
-17
No files found.
docsite/latest/rst/playbooks2.rst
View file @
feb4a884
...
@@ -73,25 +73,22 @@ Overriding Changed Result
...
@@ -73,25 +73,22 @@ Overriding Changed Result
.. versionadded:: 1.3
.. versionadded:: 1.3
When a task make some changes or sometimes is simply executed, it
When a shell/command or other module runs it will typically report
is reported as changed. You may want to override this. To do so,
"changed" status based on whether it thinks it affected machine state.
write a task with the `changed_when` clause, which actually is a
Python expression. When this expression evaluates to true the task
Sometimes you will know, based on the return code
is considered changed, when it evaluates to false the tasks is
or output that it did not make any changes, and wish to override
considered changed. See below about the `when` clause for details
the "changed" result such that it does not appear in report output or
on the expressions you can use. You may also find the `register`
does not cause handlers to fire::
keyword useful with `changed_when`, see below.
Example::
tasks:
tasks:
- action: command some command with output
register: result
- shell: /usr/bin/billybass --mode="take me to the river"
changed_when: "'reticulating splines' in result.stdout"
register: bass_result
- action: command another command
changed_when: "bass_result.rc != 2"
register: another_result
changed_when: "another_result.rc != 2"
# this will never report 'changed' status
- action: command yet another command
- shell: wall 'beep'
changed_when: false # never changed !
Accessing Complex Variable Data
Accessing Complex Variable Data
```````````````````````````````
```````````````````````````````
...
...
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