]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
docker: fix ceph.conf generation for multiple mons
authorAndrew Schoen <aschoen@redhat.com>
Wed, 7 Dec 2016 23:02:02 +0000 (17:02 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 7 Dec 2016 23:22:10 +0000 (17:22 -0600)
Before this patch only the address for the first mon would show
in the ceph.conf even if there were multiple mons in the inventory.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/ceph-common/templates/ceph.conf.j2

index 568eab00efbb1af15eecea3819bcab3efcd8e069..a8af40626dc58bd0a37f6c5b72357804f66203ba 100644 (file)
@@ -50,19 +50,17 @@ mon host = {% for host in groups[mon_group_name] %}
 {% if mon_containerized_deployment %}
 fsid = {{ fsid }}
 {% if groups[mon_group_name] is defined %}
-mon host = {% for host in groups[mon_group_name] -%}
-{% if mon_containerized_deployment %}
-{% set interface = ["ansible_",ceph_mon_docker_interface]|join %}
-{{ hostvars[host][interface]['ipv4']['address'] }}
-{%- if not loop.last %},{% endif %}
-{% elif hostvars[host]['monitor_address'] is defined %}
-{{ hostvars[host]['monitor_address'] }}
-{%- if not loop.last %},{% endif %}
-{% elif monitor_address != "0.0.0.0" %}
-monitor_address
-{%- if not loop.last %},{% endif %}
-{% endif %}
-{%- endfor %}
+mon host = {% for host in groups[mon_group_name] %}
+             {% set interface = ["ansible_",ceph_mon_docker_interface]|join %}
+             {% if mon_containerized_deployment -%}
+                {{ hostvars[host][interface]['ipv4']['address'] }}
+             {%- elif hostvars[host]['monitor_address'] is defined -%}
+                {{ hostvars[host]['monitor_address'] }}
+             {%- elif monitor_address != "0.0.0.0" -%}
+                {{ monitor_address }}
+             {%- endif %}
+             {%- if not loop.last %},{% endif %}
+           {% endfor %}
 {% endif %}
 {% endif %}