# suggestions to make my master playbook simpler

**URL:** <https://forum.ansible.com/t/suggestions-to-make-my-master-playbook-simpler/13703>\
**Category:** Ansible Developer\
**Created:** [October 17, 2013, 9:48am UTC](https://forum.ansible.com/t/suggestions-to-make-my-master-playbook-simpler/13703 "2013-10-17T09:48:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_G](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Nicolas\_G](https://forum.ansible.com/u/Nicolas_G)\
**Post date:** [October 17, 2013, 9:48am UTC](https://forum.ansible.com/t/suggestions-to-make-my-master-playbook-simpler/13703/1 "2013-10-17T09:48:10Z")

</div>

Hi,

I have a master playbook to deploy 10 different group servers per region but would like to make things simpler. As you can see the vars\_files section and handlers bellow is the same on all groups, the only things that changes is the “hosts” line and the specific role for each group type. I could create 10 separate files for every group server and call all files from a master playbook using the “- include” statement but what I would really like to avoid here is to have to define all those same vars\_files and handlers for each group.

Is it possible to define all vars\_files and handlers in a single place ?

“”"

- hosts: A-group-servers  
user: root  
vars\_files:

# Global defaults

- group\_vars/all.yml

# Password & Access keys

- private\_vars/prod-secret-vars.yml

# Enviroment values

- group\_vars/prod-eu-west.yml  
handlers:

- include: roles/common/handlers/main.yml  
roles:

- { role : common , tags: [‘common-role’] }

- { role : visitor-profile , tags: [‘a-group-role’] }  
post\_tasks:

- include: roles/common/tasks/couchbase-rebalance.yml

- hosts: B-group-servers  
user: root  
vars\_files:

# Global defaults

- group\_vars/all.yml

# Password & Access keys

- private\_vars/prod-secret-vars.yml

# Enviroment values

- group\_vars/prod-eu-west.yml  
handlers:
- include: roles/common/handlers/main.yml  
roles:
- { role : common , tags: [‘common-role’] }
- { role : visitor-profile , tags: [‘b-group-role’] }

.  
.  
.  
.  
.  
“”"

Regards,  
Nicolas.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 17, 2013, 12:14pm UTC](https://forum.ansible.com/t/suggestions-to-make-my-master-playbook-simpler/13703/2 "2013-10-17T12:14:45Z")

</div>

Hi Nicolas,

This is really a question for ansible-project list.

Can you post there?

---

<div class="post-metadata">

**Author:** ![Nicolas\_G](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Nicolas\_G](https://forum.ansible.com/u/Nicolas_G)\
**Post date:** [October 17, 2013, 1:42pm UTC](https://forum.ansible.com/t/suggestions-to-make-my-master-playbook-simpler/13703/3 "2013-10-17T13:42:46Z")

</div>

sorry .
