Merge pull request #7491 from hkariti/doc_group_vars_dir

Update docs to include directories inside group_vars
This commit is contained in:
Michael DeHaan 2014-08-22 15:09:37 -04:00
commit f54665aa51

View file

@ -171,6 +171,17 @@ the 'raleigh' group might look like::
It is ok if these files do not exist, as this is an optional feature. It is ok if these files do not exist, as this is an optional feature.
As an advanced use-case, you can create *directories* named after your groups or hosts, and
Ansible will read all the files in these directories. An example with the 'raleigh' group::
/etc/ansible/group_vars/raleigh/db_settings
/etc/ansible/group_vars/raleigh/cluster_settings
All hosts that are in the 'raleigh' group will have the variables defined in these files
available to them. This can be very useful to keep your variables organized when a single
file starts to be too big, or when you want to use :doc:`Ansible Vault<playbooks_vault>` on a part of a group's
variables. Note that this only works on Ansible 1.4 or later.
Tip: In Ansible 1.2 or later the group_vars/ and host_vars/ directories can exist in either Tip: In Ansible 1.2 or later the group_vars/ and host_vars/ directories can exist in either
the playbook directory OR the inventory directory. If both paths exist, variables in the playbook the playbook directory OR the inventory directory. If both paths exist, variables in the playbook
directory will be loaded second. directory will be loaded second.