From: Andrew Schoen Date: Wed, 7 Dec 2016 23:02:02 +0000 (-0600) Subject: docker: fix ceph.conf generation for multiple mons X-Git-Tag: v2.2.10~75 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0a80cd6dfecc30a45a6d28b7fec2a8c99eb57e36;p=ceph-ansible.git docker: fix ceph.conf generation for multiple mons 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 --- diff --git a/templates/ceph.conf.j2 b/templates/ceph.conf.j2 index 568eab00e..a8af40626 100644 --- a/templates/ceph.conf.j2 +++ b/templates/ceph.conf.j2 @@ -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 %}