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