Appendix C. Configuring Ansible inventory location
As an option, you can configure inventory location files for the ceph-ansible
staging and production environments.
Prerequisites
- An Ansible administration node.
- Root-level access to the Ansible administration node.
-
The
ceph-ansible
package is installed on the node.
Procedure
Navigate to the
/usr/share/ceph-ansible
directory:[ansible@admin ~]# cd /usr/share/ceph-ansible
Create subdirectories for staging and production:
[ansible@admin ceph-ansible]$ mkdir -p inventory/staging inventory/production
Edit the
ansible.cfg
file and add the following lines:[defaults] inventory = ./inventory/staging # Assign a default inventory directory
Create an inventory 'hosts' file for each environment:
[ansible@admin ceph-ansible]$ touch inventory/staging/hosts [ansible@admin ceph-ansible]$ touch inventory/production/hosts
Open and edit each
hosts
file and add the Ceph Monitor nodes under the[mons]
section:[mons] MONITOR_NODE_NAME_1 MONITOR_NODE_NAME_1 MONITOR_NODE_NAME_1
Example
[mons] mon-stage-node1 mon-stage-node2 mon-stage-node3
NoteBy default, playbooks run in the staging environment. To run the playbook in the production environment:
[ansible@admin ceph-ansible]$ ansible-playbook -i inventory/production playbook.yml
Additional Resources
-
For more information about installing the
ceph-ansible
package, see Installing a Red Hat Storage Cluster.