Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ceph-facts: move grafana fact to dedicated file
We don't need to executed the grafana fact everytime but only during the dashboard deployment. Especially for ceph-grafana, ceph-prometheus and ceph-dashboard roles. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1790303 Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
- Loading branch information
Showing
3 changed files
with
43 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
- name: set grafana_server_addr fact - ipv4 | ||
set_fact: | ||
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}" | ||
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: | ||
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}" | ||
when: | ||
- groups.get(grafana_server_group_name, []) | length > 0 | ||
- ip_version == 'ipv6' | ||
- dashboard_enabled | bool | ||
- inventory_hostname in groups[grafana_server_group_name] | ||
|
||
- name: set grafana_server_addr fact - ipv4 - (external instance) | ||
set_fact: | ||
grafana_server_addr: "{{ hostvars[groups.get(grafana_server_group_name, []) | first]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}" | ||
when: | ||
- groups.get(grafana_server_group_name, []) | length > 0 | ||
- ip_version == 'ipv4' | ||
- dashboard_enabled | bool | ||
- inventory_hostname not in groups[grafana_server_group_name] | ||
|
||
- name: set grafana_server_addr fact - ipv6 - (external instance) | ||
set_fact: | ||
grafana_server_addr: "{{ hostvars[groups.get(grafana_server_group_name, []) | first]['ansible_all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}" | ||
when: | ||
- groups.get(grafana_server_group_name, []) | length > 0 | ||
- ip_version == 'ipv6' | ||
- dashboard_enabled | bool | ||
- inventory_hostname not in groups[grafana_server_group_name] |