Have you ever been curious about what it would take to just have one ceph-ansible node manage all your Ceph environments? Well fortunately you're not alone, and this is something already possible with the use of ansible inventory directories. The configuration process as a whole is not bad, but it requires you to be both organized and disciplined with the changes you make to group_vars/*.yml files. For this example we will be configuring two environments: staging, and production.
- Create the two site inventory directories:
cd /usr/share/ceph-ansible
mkdir -p inventory/staging inventory/production
2. Update your ansible.cfg in /usr/share/ceph-ansible to reflect a default inventory(in case someone wants to dev in prod):
[defaults]
inventory = ./inventory/staging # Assigning staging env as default
3. Create your inventory files named ‘hosts’ for each environment:
vi inventory/staging/hosts:
----
[mons]
--SNIP--
...
vi inventory/production/hosts:
----
[mons]
--SNIP--
...
4. Begin running ceph-ansible playbooks against different environments, in this case production:
ansible-playbook -i inventory/production playbook.yml
Note: from here on out you will need to reference <dir>/<environment> to run against any environment !default.
Additional information around inventories and variable files can be referenced at: Ansible Documentation.
Comments