From f4cbb21093e00df8e2e54a32891afba0f9876dd8 Mon Sep 17 00:00:00 2001 From: Logan V Date: Fri, 2 Jun 2017 10:04:45 -0500 Subject: [PATCH] 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 --- group_vars/all/ceph.yml | 6 ++++++ tests/roles/bootstrap-host/tasks/prepare_ceph.yml | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/group_vars/all/ceph.yml b/group_vars/all/ceph.yml index 1be431822d..0db744e37c 100644 --- a/group_vars/all/ceph.yml +++ b/group_vars/all/ceph.yml @@ -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 }}" diff --git a/tests/roles/bootstrap-host/tasks/prepare_ceph.yml b/tests/roles/bootstrap-host/tasks/prepare_ceph.yml index cb2623b63c..efaba66b61 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_ceph.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_ceph.yml @@ -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