mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 05:11:25 -07:00
add note about register + skip (#51339)
* add note about register + skip fixes #27968 * Update docs/docsite/rst/user_guide/playbooks_conditionals.rst Co-Authored-By: bcoca <bcoca@users.noreply.github.com> * Update docs/docsite/rst/user_guide/playbooks_conditionals.rst Co-Authored-By: bcoca <bcoca@users.noreply.github.com>
This commit is contained in:
parent
5d15a539c7
commit
eebece91b1
1 changed files with 2 additions and 0 deletions
|
@ -278,6 +278,8 @@ Often in a playbook it may be useful to store the result of a given command in a
|
||||||
it later. Use of the command module in this way can in many ways eliminate the need to write site specific facts, for
|
it later. Use of the command module in this way can in many ways eliminate the need to write site specific facts, for
|
||||||
instance, you could test for the existence of a particular program.
|
instance, you could test for the existence of a particular program.
|
||||||
|
|
||||||
|
.. note:: Registration happens even when a task is skipped due to the conditional. This way you can query the variable for `` is skipped`` to know if task was attempted or not.
|
||||||
|
|
||||||
The 'register' keyword decides what variable to save a result in. The resulting variables can be used in templates, action lines, or *when* statements. It looks like this (in an obviously trivial example)::
|
The 'register' keyword decides what variable to save a result in. The resulting variables can be used in templates, action lines, or *when* statements. It looks like this (in an obviously trivial example)::
|
||||||
|
|
||||||
- name: test play
|
- name: test play
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue