Delegation of plays

60 views
Skip to first unread message

Tony Yarusso

unread,
Sep 15, 2015, 2:59:04 PM9/15/15
to Ansible Project
So, for both security and other management reasons, we have several (currently 12) separate "environments", firewalled off from each other, each with their own Ansible server.  That's fine for most things, but certain one-off tasks (eg. changing my password) are a pain, since I have to do it 12 times.  I'm wondering what the best way would be to execute a play on one machine and have all 12 Ansible servers run it against their respective inventories.  So far what I've come up with is I could create the playbook on the "master" machine, have a task using the copy module to send it out to the 12 environment deploy servers, then another task using the command module with delegate_to with a list of those servers to run ansible-playbook with it on each of them.  Is that the best route, or is there something more direct?

Brian Coca

unread,
Sep 23, 2015, 2:01:34 PM9/23/15
to Ansible Project
it seems you should be able to still run directly by using each
ansible host as a jumphost. If not, ansible-pull might be a better
option here.


--
Brian Coca

Tony Yarusso

unread,
Sep 23, 2015, 5:32:21 PM9/23/15
to ansible...@googlegroups.com
Sounds like we'll need to a) rework our inventory a bit, and b) wait
for v2.0 for that to work, but could be an option.

Joanna Delaporte

unread,
Sep 24, 2015, 1:23:28 PM9/24/15
to Ansible Project
Hi Tony,

If I understand correctly, the issue is that the master server cannot connect to the inventoried hosts on each 'slave' host, and possibly is not aware they exist. In that case, it sounds like your solution is pretty solid.

Joanna
Reply all
Reply to author
Forward
0 new messages