BC> This is 'expected' with pause or any other module that bypasses the
BC> normal host loop, or if you add `run_once: yes` to a task.
https://github.com/ansible/ansible/issues/19966 is a ticket about this.
As I commented there: It's very unintuitive that if I have a playbook that
runs on ten hosts, but with a when condition such that some of the hosts
are sometimes skipped (e.g. if they're down at the moment, if they're in
the green rather than the blue group, etc), and somewhere in the middle is
a pause or other run_once task, that task will or won't run in a
completely unpredictable way based on the order of the host list.
Saying "if any hosts are skipped, a run_once task might or might not run"
seems obviously wrong to me, and not like a "feature" at all.
If run_once picked the first non-skipped host on the list, that seems like
it would completely solve this. (If the entire host list was being
skipped, then of course the task would be skipped too.) Is that possible?
-Josh (
j...@care.com)
(apologies for the automatic corporate disclaimer that follows)
This email is intended for the person(s) to whom it is addressed and may contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, distribution, copying, or disclosure by any person other than the addressee(s) is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email and delete the message and any attachments from your system.