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

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

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

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 for more about group vars.

Hope this helps,

Jon

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