# Delegation of plays

**URL:** <https://forum.ansible.com/t/delegation-of-plays/19272>\
**Category:** Ansible Project\
**Created:** [September 15, 2015, 6:59pm UTC](https://forum.ansible.com/t/delegation-of-plays/19272 "2015-09-15T18:59:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Yarusso](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@Tony\_Yarusso](https://forum.ansible.com/u/Tony_Yarusso)\
**Post date:** [September 15, 2015, 6:59pm UTC](https://forum.ansible.com/t/delegation-of-plays/19272/1 "2015-09-15T18:59:04Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [September 23, 2015, 6:01pm UTC](https://forum.ansible.com/t/delegation-of-plays/19272/2 "2015-09-23T18:01:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tony\_Yarusso](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@Tony\_Yarusso](https://forum.ansible.com/u/Tony_Yarusso)\
**Post date:** [September 23, 2015, 9:32pm UTC](https://forum.ansible.com/t/delegation-of-plays/19272/3 "2015-09-23T21:32:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jdelaporte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jdelaporte/32/366_2.png) [@jdelaporte](https://forum.ansible.com/u/jdelaporte)\
**Post date:** [September 24, 2015, 5:23pm UTC](https://forum.ansible.com/t/delegation-of-plays/19272/4 "2015-09-24T17:23:28Z")

</div>

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
