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 <aschoen@redhat.com>
pull/1150/head
Andrew Schoen 2016-12-07 17:02:02 -06:00
parent 26a0e8a084
commit 9942b5028a
1 changed files with 11 additions and 13 deletions

View 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 %}