]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
correctly set mon addr when monitor_interface is defined in group_vars 720/head
authorAndrew Schoen <aschoen@redhat.com>
Thu, 21 Apr 2016 14:09:16 +0000 (09:09 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 21 Apr 2016 14:09:16 +0000 (09:09 -0500)
This fixes the ceph.conf template so that it will look for an inventory
defined value for monitor_interface or for monitor_interface defined in
a group_vars file.

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

index 113e738c3d4b72c4fe3b682db5183ab7a33fa79c..23482bdce27fcebe3a76e5ef2221bc54f16667e6 100644 (file)
@@ -99,7 +99,8 @@ host = {{ hostvars[host]['ansible_fqdn'] }}
 [mon.{{ hostvars[host]['ansible_hostname'] }}]
 host = {{ hostvars[host]['ansible_hostname'] }}
 {% endif %}
-{% if hostvars[host]['monitor_interface'] is defined and hostvars[host]['monitor_interface'] != "interface" %}
+# we need to check if monitor_interface is defined in the inventory per host or if it's set in a group_vars file
+{% if (hostvars[host]['monitor_interface'] is defined and hostvars[host]['monitor_interface'] != "interface") or monitor_interface != "interface" %}
 {% include 'mon_addr_interface.j2' %}
 {% else %}
 {% include 'mon_addr_address.j2' %}