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

  1. Navigate to the /usr/share/ceph-ansible directory:

    [ansible@admin ~]# cd /usr/share/ceph-ansible
  2. Create subdirectories for staging and production:

    [ansible@admin ceph-ansible]$ mkdir -p inventory/staging inventory/production
  3. Edit the ansible.cfg file and add the following lines:

    [defaults]
    inventory = ./inventory/staging # Assign a default inventory directory
  4. Create an inventory 'hosts' file for each environment:

    [ansible@admin ceph-ansible]$ touch inventory/staging/hosts
    [ansible@admin ceph-ansible]$ touch inventory/production/hosts
    1. 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

      Note

      By 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