make grafana network a configurable option

Signed-off-by: Danny Webb <danny.webb@thehutgroup.com>
pull/7016/head
Danny Webb 2021-11-23 16:28:02 +00:00 committed by Guillaume Abrioux
parent 20035852a4
commit 189ff93372
4 changed files with 7 additions and 4 deletions

View File

@ -695,6 +695,7 @@ dummy:
# - grafana-piechart-panel # - grafana-piechart-panel
#grafana_allow_embedding: True #grafana_allow_embedding: True
#grafana_port: 3000 #grafana_port: 3000
#grafana_network: "{{ public_network }}"
#grafana_conf_overrides: {} #grafana_conf_overrides: {}
#prometheus_container_image: "docker.io/prom/prometheus:v2.7.2" #prometheus_container_image: "docker.io/prom/prometheus:v2.7.2"
#prometheus_container_cpu_period: 100000 #prometheus_container_cpu_period: 100000

View File

@ -695,6 +695,7 @@ grafana_container_image: registry.redhat.io/rhceph/rhceph-5-dashboard-rhel8:5
# - grafana-piechart-panel # - grafana-piechart-panel
#grafana_allow_embedding: True #grafana_allow_embedding: True
#grafana_port: 3000 #grafana_port: 3000
#grafana_network: "{{ public_network }}"
#grafana_conf_overrides: {} #grafana_conf_overrides: {}
prometheus_container_image: registry.redhat.io/openshift4/ose-prometheus:v4.6 prometheus_container_image: registry.redhat.io/openshift4/ose-prometheus:v4.6
#prometheus_container_cpu_period: 100000 #prometheus_container_cpu_period: 100000

View File

@ -687,6 +687,7 @@ grafana_plugins:
- grafana-piechart-panel - grafana-piechart-panel
grafana_allow_embedding: True grafana_allow_embedding: True
grafana_port: 3000 grafana_port: 3000
grafana_network: "{{ public_network }}"
grafana_conf_overrides: {} grafana_conf_overrides: {}
prometheus_container_image: "docker.io/prom/prometheus:v2.7.2" prometheus_container_image: "docker.io/prom/prometheus:v2.7.2"
prometheus_container_cpu_period: 100000 prometheus_container_cpu_period: 100000

View File

@ -1,6 +1,6 @@
- name: set grafana_server_addr fact - ipv4 - name: set grafana_server_addr fact - ipv4
set_fact: set_fact:
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}" grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(grafana_network.split(',')) | first }}"
when: when:
- groups.get(monitoring_group_name, []) | length > 0 - groups.get(monitoring_group_name, []) | length > 0
- ip_version == 'ipv4' - ip_version == 'ipv4'
@ -9,7 +9,7 @@
- name: set grafana_server_addr fact - ipv6 - name: set grafana_server_addr fact - ipv6
set_fact: set_fact:
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}" grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(grafana_network.split(',')) | last | ipwrap }}"
when: when:
- groups.get(monitoring_group_name, []) | length > 0 - groups.get(monitoring_group_name, []) | length > 0
- ip_version == 'ipv6' - ip_version == 'ipv6'
@ -18,7 +18,7 @@
- name: set grafana_server_addrs fact - ipv4 - name: set grafana_server_addrs fact - ipv4
set_fact: set_fact:
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first]) | unique }}" grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(grafana_network.split(',')) | first]) | unique }}"
with_items: "{{ groups.get(monitoring_group_name, []) }}" with_items: "{{ groups.get(monitoring_group_name, []) }}"
when: when:
- groups.get(monitoring_group_name, []) | length > 0 - groups.get(monitoring_group_name, []) | length > 0
@ -27,7 +27,7 @@
- name: set grafana_server_addrs fact - ipv6 - name: set grafana_server_addrs fact - ipv6
set_fact: set_fact:
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap]) | unique }}" grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(grafana_network.split(',')) | last | ipwrap]) | unique }}"
with_items: "{{ groups.get(monitoring_group_name, []) }}" with_items: "{{ groups.get(monitoring_group_name, []) }}"
when: when:
- groups.get(monitoring_group_name, []) | length > 0 - groups.get(monitoring_group_name, []) | length > 0