run_once clause
When the run_once clause is present and set to a truthy value, the instruction it is attached to will only be executed the first time it is encountered.
This commit is contained in:
parent
14fca45cb7
commit
446280ab6e
3 changed files with 27 additions and 10 deletions
example
|
@ -30,12 +30,15 @@ instructions:
|
|||
- action: stop
|
||||
|
||||
# Only create the managed groups if we *have* managed hosts
|
||||
- action: create_group
|
||||
group: managed
|
||||
- loop: [by_environment, by_network, by_failover_stack, by_service]
|
||||
action: create_group
|
||||
group: "{{ item }}"
|
||||
parent: managed
|
||||
- action: block
|
||||
run_once: true
|
||||
block:
|
||||
- action: create_group
|
||||
group: managed
|
||||
- loop: [by_environment, by_network, by_failover_stack, by_service]
|
||||
action: create_group
|
||||
group: "{{ item }}"
|
||||
parent: managed
|
||||
|
||||
# Copy inv__data fields to separate inv__ variables
|
||||
- loop:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue