]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Common: monitor_address_block is always defined
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 4 Jul 2017 15:29:26 +0000 (17:29 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 4 Jul 2017 15:50:30 +0000 (17:50 +0200)
monitor_address_block is always defined.
We need to check for true or false instead.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-common/templates/ceph.conf.j2

index 42d111532e581e2d45249ba1a042c9f484065094..1434ae2400e9cf3b9da79e2baadd522370a9b02e 100644 (file)
@@ -32,7 +32,7 @@ mon initial members = {% for host in groups[mon_group_name] %}
 
 {% if not containerized_deployment and not containerized_deployment_with_kv -%}
 mon host = {% for host in groups[mon_group_name] -%}
-    {% if monitor_address_block is defined %}
+    {% if monitor_address_block | length > 0 %}
       {% if ip_version == 'ipv4' -%}
         {{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}
       {%- elif ip_version == 'ipv6' -%}
@@ -58,7 +58,7 @@ mon host = {% for host in groups[mon_group_name] -%}
 {% if containerized_deployment %}
 fsid = {{ fsid }}
 mon host = {% for host in groups[mon_group_name] -%}
-    {% if monitor_address_block is defined %}
+    {% if monitor_address_block | length > 0 %}
       {% if ip_version == 'ipv4' -%}
         {{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}
       {%- elif ip_version == 'ipv6' -%}