Actually after re-reading your post Brian. I can have 1 play with multiple tasks set to run_once or use a when conditional; I could also just use multiple plays to accomplish this. I was hopeful there was a way to use a for loop to loop over specific hosts running the task individually per host; however I am thinking that would make this too complex.I plan to use a role for this and break up my tasks in the tasks/main.yml file.
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/34575a03-0919-487e-9fbd-b5e5b7d2c30b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
