openstack-ansible/doc/source/contributor/inventory-and-vars.rst
Jimmy McCrory 2a1f1ccd55 [Docs] Fix links to inventory docs
The documentation on generating inventory was referenced as
'generate-inventory' in a table of contents index but the actual file
was named 'inventory' so it was never listed. The file has been renamed.

Also, a page in the developer docs included duplicated information from
the inventory docs. That page has been deleted and the link to it has
been replaced with one to the more complete inventory docs.

Change-Id: I6e1cda1daa1931c925b93872565994109216e7ea
2017-10-28 23:11:58 -07:00

1.5 KiB

Inventory and variables

Our dynamic Inventory

OpenStack-Ansible ships with its own dynamic inventory. You can find more explanations on the inventory here.

Variable precedence

Role defaults

Every role has a file, defaults/main.yml which holds the usual variables overridable by a deployer, like a regular Ansible role. This defaults are the closest possible to OpenStack standards.

Group vars and host vars

OpenStack-Ansible provides safe defaults for deployers in its group_vars folder. They take care of the wiring between different roles, like for example storing information on how to reach RabbitMQ from nova role.

You can override the existing group vars (and host vars) by creating your own folder in /etc/openstack_deploy/group_vars (and /etc/openstack_deploy/host_vars respectively).

If you want to change the location of the override folder, you can adapt your openstack-ansible.rc file, or export GROUP_VARS_PATH and HOST_VARS_PATH during your shell session.

Role vars

Because OpenStack-Ansible is following Ansible precedence, every role vars/ will take precedence over group vars. This is intentional. You should avoid overriding these variables.

User variables

If you want to override a playbook or a role variable, you can define the variable you want to override in a /etc/openstack_deploy/user_*.yml file.