]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Set grafana_server_addr fact for ipv6 scenarios.
authorfmount <fpantano@redhat.com>
Wed, 19 Jun 2019 11:52:31 +0000 (13:52 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Wed, 26 Jun 2019 16:02:29 +0000 (12:02 -0400)
As the bz1721914 describes, the grafana_server_addr
fact is not defined if ip_version used is ipv6.
This commit adds the ip_version condition to set
correctly this fact.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1721914
Signed-off-by: fmount <fpantano@redhat.com>
(cherry picked from commit e655038743a16e75cb993d1a26c7be755a65ca45)

roles/ceph-facts/tasks/facts.yml

index e76b915d82fc954944de965b3d39cb24a14abd22..1988b34120a9842bf44812ab712994379475f0ab 100644 (file)
         chrony_daemon_name: chrony
       when: ansible_os_family == "Debian"
 
-- name: set grafana_server_addr fact
+- name: set grafana_server_addr fact - ipv4
   set_fact:
     grafana_server_addr: "{{ (hostvars[groups[grafana_server_group_name][0] if groups.get(grafana_server_group_name, []) | length > 0 else groups[mgr_group_name][0]])['ansible_all_ipv4_addresses'] | ipaddr(public_network) | first }}"
   when:
     - (groups.get(grafana_server_group_name, []) | length > 0 or groups.get(mgr_group_name, []) | length > 0)
+    - ip_version == 'ipv4'
+    - dashboard_enabled | bool
+
+- name: set grafana_server_addr fact - ipv6
+  set_fact:
+    grafana_server_addr: "{{ (hostvars[groups[grafana_server_group_name][0] if groups.get(grafana_server_group_name, []) | length > 0 else groups[mgr_group_name][0]])['ansible_all_ipv6_addresses'] | ipaddr(public_network) | last | ipwrap }}"
+  when:
+    - (groups.get(grafana_server_group_name, []) | length > 0 or groups.get(mgr_group_name, []) | length > 0)
+    - ip_version == 'ipv6'
     - dashboard_enabled | bool