]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
common: check for monitor_interface before monitor_address in ceph.conf
authorAndrew Schoen <aschoen@redhat.com>
Sat, 5 Nov 2016 15:50:46 +0000 (10:50 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 8 Nov 2016 16:35:42 +0000 (10:35 -0600)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
Resolves: testing#updates

roles/ceph-common/templates/ceph.conf.j2

index 25e5133692d63cf278f3753f3a2f4f8901e56f77..7cf82fe5fefbcf55b6a1306ca1ee63d1f3e9e36a 100644 (file)
@@ -21,21 +21,21 @@ mon initial members = {% if groups[mon_group_name] is defined %}{% for host in g
 {% endif %}
 
 {% if not mon_containerized_deployment and not mon_containerized_deployment_with_kv %}
-{% if monitor_address_block is defined %}
+{% if monitor_address_block %}
 mon host = {% for host in groups[mon_group_name] %}{{ hostvars[host]['ansible_all_ipv4_addresses'] | ipaddr(monitor_address_block) | first }}{% if not loop.last %},{% endif %}{% endfor %}
 {% elif groups[mon_group_name] is defined %}
 mon host = {% for host in groups[mon_group_name] %}
              {% set address = hostvars[host]['monitor_address'] if hostvars[host]['monitor_address'] is defined else monitor_address %}
              {% set interface = hostvars[host]['monitor_interface'] if hostvars[host]['monitor_interface'] is defined else monitor_interface %}
-             {% if address != "0.0.0.0" -%}
-               {{ address }}
-             {%- else %}
+             {% if interface != "interface" %}
                {% for key in hostvars[host].iterkeys() %}
                  {% if hostvars[host][key]['macaddress'] is defined and hostvars[host][key]['device'] is defined and hostvars[host][key]['device'] == interface -%}
                     {{ hostvars[host][key]['ipv4']['address'] }}
                  {%- endif %}
                {% endfor %}
-             {% endif %}
+             {% elif address != "0.0.0.0" -%}
+               {{ address }}
+             {%- endif %}
              {%- if not loop.last %},{% endif %}
            {% endfor %}
 {% endif %}