]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
config: make sure ceph_release is set for all client node
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 21 Jan 2019 15:08:00 +0000 (16:08 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 22 Jan 2019 12:45:38 +0000 (13:45 +0100)
`ceph_release` is set in `ceph-container-common` but this role is
played only on first node for clients, this means ceph-config will fail
on all client nodes except the first one.

This commit ensure ceph_release is set for all client nodes.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-config/templates/ceph.conf.j2

index 4c163a5087003280c3cf1778c759cc60f55e62ab..d7fb60d7429ae04d4dbb279d6506cfd1408cc667 100644 (file)
@@ -19,7 +19,9 @@ osd crush chooseleaf type = 0
 {% set nb_mon = groups.get(mon_group_name, []) | length | int %}
 {% set nb_client = groups.get(client_group_name, []) | length | int %}
 {% set nb_osd = groups.get(osd_group_name, []) | length | int %}
-
+{% if inventory_hostname in groups.get(client_group_name, []) and not inventory_hostname == groups.get(client_group_name, []) | first %}}
+{% set ceph_release = hostvars[groups[client_group_name][0]]['ceph_release'] %}}
+{% endif %}}
 
 {% if nb_mon > 0 and inventory_hostname in groups.get(mon_group_name, []) %}
 mon initial members = {% for host in groups[mon_group_name] %}