2020-01-13 23:24:52 +08:00
|
|
|
- name: set grafana_server_addr fact - ipv4
|
|
|
|
set_fact:
|
2021-03-03 22:43:50 +08:00
|
|
|
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}"
|
2020-01-13 23:24:52 +08:00
|
|
|
when:
|
|
|
|
- groups.get(grafana_server_group_name, []) | length > 0
|
|
|
|
- ip_version == 'ipv4'
|
|
|
|
- dashboard_enabled | bool
|
|
|
|
- inventory_hostname in groups[grafana_server_group_name]
|
|
|
|
|
|
|
|
- name: set grafana_server_addr fact - ipv6
|
|
|
|
set_fact:
|
2021-03-03 22:43:50 +08:00
|
|
|
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}"
|
2020-01-13 23:24:52 +08:00
|
|
|
when:
|
|
|
|
- groups.get(grafana_server_group_name, []) | length > 0
|
|
|
|
- ip_version == 'ipv6'
|
|
|
|
- dashboard_enabled | bool
|
|
|
|
- inventory_hostname in groups[grafana_server_group_name]
|
|
|
|
|
2020-01-28 03:47:00 +08:00
|
|
|
- name: set grafana_server_addrs fact - ipv4
|
2020-01-13 23:24:52 +08:00
|
|
|
set_fact:
|
2021-03-03 22:43:50 +08:00
|
|
|
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first]) | unique }}"
|
2020-01-28 03:47:00 +08:00
|
|
|
with_items: "{{ groups.get(grafana_server_group_name, []) }}"
|
2020-01-13 23:24:52 +08:00
|
|
|
when:
|
|
|
|
- groups.get(grafana_server_group_name, []) | length > 0
|
|
|
|
- ip_version == 'ipv4'
|
|
|
|
- dashboard_enabled | bool
|
|
|
|
|
2020-01-28 03:47:00 +08:00
|
|
|
- name: set grafana_server_addrs fact - ipv6
|
2020-01-13 23:24:52 +08:00
|
|
|
set_fact:
|
2021-03-03 22:43:50 +08:00
|
|
|
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap]) | unique }}"
|
2020-01-28 03:47:00 +08:00
|
|
|
with_items: "{{ groups.get(grafana_server_group_name, []) }}"
|
2020-01-13 23:24:52 +08:00
|
|
|
when:
|
|
|
|
- groups.get(grafana_server_group_name, []) | length > 0
|
|
|
|
- ip_version == 'ipv6'
|
|
|
|
- dashboard_enabled | bool
|