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
b603bb0f
Commit
b603bb0f
authored
Jul 21, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'changed_when-doc' of
git://github.com/stoned/ansible
into devel
parents
8be17cd7
60d2ad36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
docsite/latest/rst/playbooks2.rst
+25
-0
No files found.
docsite/latest/rst/playbooks2.rst
View file @
b603bb0f
...
...
@@ -68,6 +68,31 @@ write a task that looks like this::
command: /bin/false
ignore_errors: yes
Overriding Changed Result
`````````````````````````
.. versionadded:: 1.3
When a task make some changes or sometimes is simply executed, it
is reported as changed. You may want to override this. To do so,
write a task with the `changed_when` clause, which actually is a
Python expression. When this expression evaluates to true the task
is considered changed, when it evaluates to false the tasks is
considered changed. See below about the `when` clause for details
on the expressions you can use. You may also find the `register`
keyword useful with `changed_when`, see below.
Example::
tasks:
- action: command some command with output
register: result
changed_when: "'reticulating splines' in result.stdout"
- action: command another command
register: another_result
changed_when: "another_result.rc != 2"
- action: command yet another command
changed_when: false # never changed !
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