Currently something like the following:
```
- <some action>
run_once: true
when: item == true
with_random_choice:
- true
- false
```
Will run only once even when the task is skipped (`item = false`).
There are cases when it is desired to run a task until it was run
successfully for the first time.
What if `run_once` offered a bit more options?
`run_once: success`: Run until the task is successfully run on a host
`run_once: not_skipped`: Run until task was not skipped
Or an additional task keyword (which sounds even better):
`run_until: <Any statement may be used that can also be used in when>`
That would allow great freedom in deciding until when a task is run.
It also separates well from the `until` task keyword which is used with
`retries`.
Git issues about the current limitation:
https://github.com/ansible/ansible/issues/23594
https://github.com/ansible/ansible/issues/11496
https://github.com/ansible/ansible/issues/18821
https://github.com/ansible/ansible/issues/13226
Threads:
https://groups.google.com/forum/#!topic/ansible-project/CNTYdNHaWqM
https://groups.google.com/forum/#!topic/ansible-project/0YIQktue6uA
What do you think?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/968abbfc-de26-4ce8-b7c0-cefa0df7732b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.