ansible/ansible — pull request #4758 by alanfairless (2013-10-31 22:08:31+00:00)
Title: Support organizing group and host variables across multiple files in a directory

This builds on the previous pull request for refactoring group_vars plugin.

The patch allows organizing group and host variables across multiple files in a
directory, instead of a single (perhaps lengthy) file. Splitting them into
multiple files promotes clear structure. For example a user could chose to reorganize `group_vars/production.yml` to:

```
group_vars/production/staff.yml
group_vars/production/networks.yml
group_vars/production/dns.yml
```

We've used this for about a month here at SpiderOak and it's helped keep things
organized. Of course it's better to move variables into roles when possible,
but there are cases where common variables need to be available across many
roles.

Some other benefits:
- It's more consistent with how variable files work within roles
- Smaller scoped files are easier to refactor, moving files between group vars
and roles using "git mv", preserving change history within the file.
- It's easier to compare settings between environments (for example, compare
group_vars/dev/netmap.yml to group_vars/production/netmap.yml without having
to be concerned with all the unrelated differences beyond the network map.)

The only drawback I can think of is that it might temp people to put more
things into group vars when instead they should be using roles. But I think
that danger is slight and at least smaller files then makes those things easier
to refactor into roles. :)