Set ceph_mons in group_vars

ceph_mons is used by the OSA ceph_client role, since it does not
support consuming the list of mons from a group name which is what
upstream ceph-ansible uses. So we will generate the list of mons
using the group name and prepare it for ceph_client.

This defaults the configuration to use the integrated ceph-ansible
managed ceph cluster deployment in OSA. However, if the OSA deployer
is using an externally managed cluster, they should still be able
to override ceph_mons in user_variables.

Change-Id: Ida44228c2d2919990bac46936317b6093d3ff115
This commit is contained in:
Logan V
2017-06-02 10:04:45 -05:00
parent 5b3e5a74e1
commit f4cbb21093
2 changed files with 6 additions and 3 deletions

View File

@@ -29,3 +29,9 @@ fetch_directory: /etc/openstack_deploy/ceph-fetch/
# exists. we handle the log dir creation so this is not something we need
# ceph-common to prepare for us.
rbd_client_directories: false
# The OSA ceph_client role does not support loading IPs from an inventory group,
# so we have to feed it a list of IPs
ceph_mons: "{{ groups[mon_group_name]
| map('extract', hostvars, 'ansible_host')
| list }}"

View File

@@ -54,9 +54,6 @@
content: |
---
devices: {{ ceph_create_loopback.results | map(attribute='stdout') | list | to_yaml | trim }}
# The OSA ceph_client role does not support loading IPs from an inventory group,
# so we have to feed it a list of IPs
ceph_mons: "{% raw %}[ {% for host in groups[mon_group_name] %}'{{ hostvars[host]['ansible_host'] }}'{% if not loop.last %},{% endif %}{% endfor %} ]{% endraw %}"
cinder_backends:
"RBD":
volume_driver: cinder.volume.drivers.rbd.RBDDriver