# run playbook over all of the hosts in the environment but limit execution by one host per environemnt children subgroup

**URL:** <https://forum.ansible.com/t/run-playbook-over-all-of-the-hosts-in-the-environment-but-limit-execution-by-one-host-per-environemnt-children-subgroup/25607>\
**Category:** Ansible Project\
**Created:** [September 27, 2017, 8:28am UTC](https://forum.ansible.com/t/run-playbook-over-all-of-the-hosts-in-the-environment-but-limit-execution-by-one-host-per-environemnt-children-subgroup/25607 "2017-09-27T08:28:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andriy\_Tovstik](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@Andriy\_Tovstik](https://forum.ansible.com/u/Andriy_Tovstik)\
**Post date:** [September 27, 2017, 8:28am UTC](https://forum.ansible.com/t/run-playbook-over-all-of-the-hosts-in-the-environment-but-limit-execution-by-one-host-per-environemnt-children-subgroup/25607/1 "2017-09-27T08:28:16Z")

</div>

Hi, all!

I want to do something strange. I have the next inventory in my test env:

`  
[module1\_group]  
module1-1.host.name  
module1-2.host.name  
module1-3.host.name  
module1-4.host.name

[module2\_group]  
module2-1.host.name  
module2-2.host.name

[module3\_group]  
module3-1.host.name  
module3-2.host.name

[production:children]  
module1\_group  
module2\_group  
module3\_group  
`

I need to run my upgrade playbook over all of the hosts in production group in parallel, but at the same time if two hosts belong to the same module group they should be upgraded one by one. For example when I run “ansible-playbook production upgrade-all.yml” it should run upgrade on (for ex) module1-1.host.name, module2-3.host.name, module3-2.host.name but not on module1-1.host.name and module1-4.host.name at the same time. In other words - only one host in production child group should be upgraded in one moment of time. A number of module groups and number of hosts in module group is random.

Is it possible at all?
