|
|
@ -44,13 +44,20 @@ decide to do something conditionally based on success or failure::
|
|
|
|
- command: /bin/false
|
|
|
|
- command: /bin/false
|
|
|
|
register: result
|
|
|
|
register: result
|
|
|
|
ignore_errors: True
|
|
|
|
ignore_errors: True
|
|
|
|
|
|
|
|
|
|
|
|
- command: /bin/something
|
|
|
|
- command: /bin/something
|
|
|
|
when: result|failed
|
|
|
|
when: result|failed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# In older versions of ansible use |success, now both are valid but succedded uses the correct tense.
|
|
|
|
- command: /bin/something_else
|
|
|
|
- command: /bin/something_else
|
|
|
|
when: result|succeeded
|
|
|
|
when: result|succeeded
|
|
|
|
|
|
|
|
|
|
|
|
- command: /bin/still/something_else
|
|
|
|
- command: /bin/still/something_else
|
|
|
|
when: result|skipped
|
|
|
|
when: result|skipped
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. note:: the filters have been updated in 2.1 so both `success` and `succeded` work (`fail`/`failed`, etc).
|
|
|
|
|
|
|
|
|
|
|
|
Note that was a little bit of foreshadowing on the 'register' statement. We'll get to it a bit later in this chapter.
|
|
|
|
Note that was a little bit of foreshadowing on the 'register' statement. We'll get to it a bit later in this chapter.
|
|
|
|
|
|
|
|
|
|
|
|
As a reminder, to see what facts are available on a particular system, you can do::
|
|
|
|
As a reminder, to see what facts are available on a particular system, you can do::
|
|
|
|