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-ansiblepackage is installed on the node.
Procedure
Navigate to the
/usr/share/ceph-ansibledirectory:[ansible@admin ~]# cd /usr/share/ceph-ansibleCreate subdirectories for staging and production:
[ansible@admin ceph-ansible]$ mkdir -p inventory/staging inventory/productionEdit the
ansible.cfgfile and add the following lines:[defaults] inventory = ./inventory/staging # Assign a default inventory directoryCreate an inventory 'hosts' file for each environment:
[ansible@admin ceph-ansible]$ touch inventory/staging/hosts [ansible@admin ceph-ansible]$ touch inventory/production/hostsOpen and edit each
hostsfile and add the Ceph Monitor nodes under the[mons]section:[mons] MONITOR_NODE_NAME_1 MONITOR_NODE_NAME_1 MONITOR_NODE_NAME_1Example
[mons] mon-stage-node1 mon-stage-node2 mon-stage-node3NoteBy 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-ansiblepackage, see Installing a Red Hat Storage Cluster.