From e655038743a16e75cb993d1a26c7be755a65ca45 Mon Sep 17 00:00:00 2001 From: fmount Date: Wed, 19 Jun 2019 13:52:31 +0200 Subject: [PATCH] Set grafana_server_addr fact for ipv6 scenarios. 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 --- roles/ceph-facts/tasks/facts.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/roles/ceph-facts/tasks/facts.yml b/roles/ceph-facts/tasks/facts.yml index e76b915d8..1988b3412 100644 --- a/roles/ceph-facts/tasks/facts.yml +++ b/roles/ceph-facts/tasks/facts.yml @@ -303,9 +303,18 @@ 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