From 9942b5028a2093032caf155fc9eee0767e78afb3 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Wed, 7 Dec 2016 17:02:02 -0600 Subject: [PATCH] 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 --- roles/ceph-common/templates/ceph.conf.j2 | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/roles/ceph-common/templates/ceph.conf.j2 b/roles/ceph-common/templates/ceph.conf.j2 index 568eab00e..a8af40626 100644 --- a/roles/ceph-common/templates/ceph.conf.j2 +++ b/roles/ceph-common/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 %} -- 2.39.5