]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
defaults: fix rgw restart script in handlers 2169/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 13 Nov 2017 15:27:51 +0000 (16:27 +0100)
committerSébastien Han <seb@redhat.com>
Mon, 13 Nov 2017 16:39:14 +0000 (17:39 +0100)
Like 80d32dec, the path to the fact is not correct.
In any case, we will retrieve the IP address in hostvars, the variable
is the way we get the interface name according where it has been set
(eg.: inventory host file vs. group_vars/)

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1510906
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 44df3f9102773c10011c82b5c1a20e7ae46e0001)
Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-defaults/templates/restart_rgw_daemon.sh.j2

index 82d2c667a8a59b9bac69b5a71bb2e5b8b7795484..0ac0ce821a14d2658acdd82ba6ded82906b9bdf8 100644 (file)
@@ -16,9 +16,9 @@ RGW_IP=[{{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresse
     {% endif %}
 {% elif radosgw_address_block is defined and radosgw_address_block != 'subnet' -%}
     {% if ip_version == 'ipv4' %}
-RGW_IP={{ ['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }} \
+RGW_IP={{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }} \
     {% elif ip_version == 'ipv6' %}
-RGW_IP=[{{ ['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}] \
+RGW_IP=[{{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}] \
     {% endif %}
 {% elif hostvars[inventory_hostname]['radosgw_address'] is defined and hostvars[inventory_hostname]['radosgw_address'] != 'address' -%}
     {% if ip_version == 'ipv4' %}
@@ -42,9 +42,9 @@ RGW_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}]
 {% else %}
     {% set interface = 'ansible_' + radosgw_interface %}
     {% if ip_version == 'ipv4' %}
-RGW_IP={{ [interface][ip_version]['address'] }} \
+RGW_IP={{ hostvars[inventory_hostname][interface][ip_version]['address'] }} \
     {% elif ip_version == 'ipv6' %}
-RGW_IP=[{{ [interface][ip_version][0]['address'] }}] \
+RGW_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}] \
     {% endif %}
 {% endif %}