This might be a newbie question, but I can’t figure out how to without writing a wrapper around ansible, or invoking ansible multiple times
Let’s say this is my inventory:
[some_service]
A
B
C
Some_service runs in synchronization mode so one is the master, which need to be shut down last.
The trouble is I do not know without actually running “some_command” which one is the master, so the shutdown order might be B->C->A or A->C->B, etc.
Is it possible to have ansible runs normally over these hosts, read the exit status of “some_command” and then delay executing shutdown on master until the others are done?
Hi James,
I have a doubt on your comment, Ansible runs playbook in order A,B,C for example and server B is a master server for example. How ansible runs shut down on C before B? It actually goes order A,B,C. Do you mean put the mentioned tasks in handler or tasks? I completely dint not get how we achieve this. Please give me some more details on this. Thanks.