# on/off playooks for lots of resources w/o repeating them (minimal redundancy)

**URL:** <https://forum.ansible.com/t/on-off-playooks-for-lots-of-resources-w-o-repeating-them-minimal-redundancy/21982>\
**Category:** Ansible Project\
**Created:** [July 11, 2016, 7:20am UTC](https://forum.ansible.com/t/on-off-playooks-for-lots-of-resources-w-o-repeating-them-minimal-redundancy/21982 "2016-07-11T07:20:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank\_Thommen](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@Frank\_Thommen](https://forum.ansible.com/u/Frank_Thommen)\
**Post date:** [July 11, 2016, 7:20am UTC](https://forum.ansible.com/t/on-off-playooks-for-lots-of-resources-w-o-repeating-them-minimal-redundancy/21982/1 "2016-07-11T07:20:41Z")

</div>

Hi,

I'm currently evaluating ansible as a candidate for our future CM tool. I'm stuck with the issue, that we have "blocks" of resources (e.g. a list of around 30 NFS mounts) which we'd like to be able to switch on and off w/o repeating the complete resources in two playbooks. How can we have two playbooks, one mounting the mounts, the other unmounting them w/o having to duplicate the whole list in both playbooks?

I'm sure there is a way, I just dont seem to be able to find the appropriate documentation page.

Any pointer is appreciated  
frank

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [July 11, 2016, 9:42am UTC](https://forum.ansible.com/t/on-off-playooks-for-lots-of-resources-w-o-repeating-them-minimal-redundancy/21982/2 "2016-07-11T09:42:54Z")

</div>

I can think of a couple of ways - there are probably more

One way would be by having both playbooks include a vars file which has the list of mounts in it:

[http://docs.ansible.com/ansible/include\_vars\_module.html](http://docs.ansible.com/ansible/include_vars_module.html)

or you could add the list of mounts to a group variable and have it apply to both playbooks by having both playbooks work against that group of hosts

See [http://docs.ansible.com/ansible/playbooks\_best\_practices.html#group-and-host-variables](http://docs.ansible.com/ansible/playbooks_best_practices.html#group-and-host-variables) for more about group vars.

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![Frank\_Thommen](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@Frank\_Thommen](https://forum.ansible.com/u/Frank_Thommen)\
**Post date:** [July 11, 2016, 5:41pm UTC](https://forum.ansible.com/t/on-off-playooks-for-lots-of-resources-w-o-repeating-them-minimal-redundancy/21982/3 "2016-07-11T17:41:36Z")

</div>

Thanks a lot. I'll give these a try.  
frank
