Yeah in my scenario I would have 12+ plays for this development environment. I was mainly looking for other options that would shorten the size of the playbook if I had to run a similar command across hundreds of hosts. With the when conditional, I would still need individual plays per host correct? Also, will the run_once action run the first item in the for loop for the first host, then my 2nd item in the for loop for the second host in the group, etc?
On Wednesday, August 22, 2018 at 8:50:13 AM UTC-6, Brian Coca wrote: > > Plays are what map hosts to tasks, there are a couple of other ways > you can single out a host, but a Play is the optimal path to do this. > Having multiple plays in a playbook was always the original intention > (why its named playbook), but if you insist on avoiding an additional > play, here are a couple of options: > > - when: inventory_hostname == 'specific host' > or > - run_once: True, and make sure that host is always the first host in > the selection for the play. > -- 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/321d81d5-cb4c-449e-bae3-d48dfc2584ae%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
