Skip to content

Commit

Permalink
make grafana network a configurable option
Browse files Browse the repository at this point in the history
Signed-off-by: Danny Webb <danny.webb@thehutgroup.com>
(cherry picked from commit 189ff93)
  • Loading branch information
dswebbthg authored and guits committed Jan 19, 2022
1 parent 17d8351 commit 29763ef
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions group_vars/all.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ dummy:
# - grafana-piechart-panel
#grafana_allow_embedding: True
#grafana_port: 3000
#grafana_network: "{{ public_network }}"
#grafana_conf_overrides: {}
#prometheus_container_image: "docker.io/prom/prometheus:v2.7.2"
#prometheus_container_cpu_period: 100000
Expand Down
1 change: 1 addition & 0 deletions group_vars/rhcs.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ grafana_container_image: registry.redhat.io/rhceph/rhceph-5-dashboard-rhel8:5
# - grafana-piechart-panel
#grafana_allow_embedding: True
#grafana_port: 3000
#grafana_network: "{{ public_network }}"
#grafana_conf_overrides: {}
prometheus_container_image: registry.redhat.io/openshift4/ose-prometheus:v4.6
#prometheus_container_cpu_period: 100000
Expand Down
1 change: 1 addition & 0 deletions roles/ceph-defaults/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ grafana_plugins:
- grafana-piechart-panel
grafana_allow_embedding: True
grafana_port: 3000
grafana_network: "{{ public_network }}"
grafana_conf_overrides: {}
prometheus_container_image: "docker.io/prom/prometheus:v2.7.2"
prometheus_container_cpu_period: 100000
Expand Down
8 changes: 4 additions & 4 deletions roles/ceph-facts/tasks/grafana.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- name: set grafana_server_addr fact - ipv4
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:
- groups.get(monitoring_group_name, []) | length > 0
- ip_version == 'ipv4'
Expand All @@ -9,7 +9,7 @@

- name: set grafana_server_addr fact - ipv6
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:
- groups.get(monitoring_group_name, []) | length > 0
- ip_version == 'ipv6'
Expand All @@ -18,7 +18,7 @@

- name: set grafana_server_addrs fact - ipv4
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, []) }}"
when:
- groups.get(monitoring_group_name, []) | length > 0
Expand All @@ -27,7 +27,7 @@

- name: set grafana_server_addrs fact - ipv6
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, []) }}"
when:
- groups.get(monitoring_group_name, []) | length > 0
Expand Down

0 comments on commit 29763ef

Please sign in to comment.