Sorry i'm relatively new to ansible so I may be asking a very obvious
question :(. Basically my organization has servers in two tiers, and within
those tiers there are groups. What I'm trying to make happen is an ansible
syntax that will restart all of the one tier in parallel, but will only be
restart one server in each group at a time. So, for example, the primary
tiers are frontends and backends. Within backends we have serviceA,
serviceB, and serviceC. Each of those will have multiple actual hosts tied
to it which I'll call svcA1, svcA2, svcB1, svcB2, svcC1, svcC2. What i want
to happen is (where "restart" is beginning execution and "x" means finished)
time > > > > > > > > > > > > >
svcA1 restart - x
svcA2 restart - - - x
--------------------------------
svcB1 restart x
svcB2 restart x
--------------------------------
svcC1 restart - - - - x
svcC2 restart x
So all the services labeled 1 start at the same time, and then all
subsequent services happen as soon as the previous in the group complete.
It feels like I'd ideally want something like the COMPLETELY made up:
- name: restart all things
group_by: server_name
inner_task:
- name: restart server
serial: 1
command: ./restart.sh
I kind of have this (theoretically, untested) working with something like:
- name: restart all the things
command: ./resart_all_the_things.sh
run_once: true
delegate_to: localhost
but... that feels hacky and missing the point?
Thanks!
--
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/6edf2893-4e83-4539-8d96-c3ca9877f84e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.