changed_when: false
until: ac_result.rc == 0
-- name: set grafana url
- command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-url {{ dashboard_protocol }}://{{ grafana_server_addr }}:{{ grafana_port }}"
- delegate_to: "{{ groups[mon_group_name][0] }}"
- run_once: true
- changed_when: false
-
- name: set grafana api user
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-username {{ grafana_admin_user }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
changed_when: false
- name: set alertmanager host
- command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-alertmanager-api-host {{ dashboard_protocol }}://{{ grafana_server_addr }}:{{ alertmanager_port }}"
+ command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-alertmanager-api-host {{ dashboard_protocol }}://{{ grafana_server_addrs | first }}:{{ alertmanager_port }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
changed_when: false
- name: set prometheus host
- command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-prometheus-api-host {{ dashboard_protocol }}://{{ grafana_server_addr }}:{{ prometheus_port }}"
+ command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-prometheus-api-host {{ dashboard_protocol }}://{{ grafana_server_addrs | first }}:{{ prometheus_port }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
changed_when: false
+- include_tasks: configure_grafana_layouts.yml
+ with_items: '{{ grafana_server_addrs }}'
+ vars:
+ grafana_server_addr: '{{ item }}'
+
- name: dashboard object gateway management frontend
when: groups.get(rgw_group_name, []) | length > 0
block:
run_once: true
when: ip_version == 'ipv6'
-- name: inject grafana dashboard layouts
- command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard grafana dashboards update"
- delegate_to: "{{ groups[mon_group_name][0] }}"
- run_once: true
- changed_when: false
- when: containerized_deployment | bool
-
- name: disable mgr dashboard module (restart)
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} mgr module disable dashboard"
changed_when: false
--- /dev/null
+---
+- name: set grafana url
+ command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-url {{ dashboard_protocol }}://{{ grafana_server_addr }}:{{ grafana_port }}"
+ delegate_to: "{{ groups[mon_group_name][0] }}"
+ run_once: true
+ changed_when: false
+
+- name: inject grafana dashboard layouts
+ command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard grafana dashboards update"
+ delegate_to: "{{ groups[mon_group_name][0] }}"
+ run_once: true
+ changed_when: false
+ when: containerized_deployment | bool
- dashboard_enabled | bool
- inventory_hostname in groups[grafana_server_group_name]
-- name: set grafana_server_addr fact - ipv4 - (external instance)
+- name: set grafana_server_addrs fact - ipv4
set_fact:
- grafana_server_addr: "{{ hostvars[groups.get(grafana_server_group_name, []) | first]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}"
+ grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first]) | unique }}"
+ with_items: "{{ groups.get(grafana_server_group_name, []) }}"
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)
+- name: set grafana_server_addrs fact - ipv6
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 }}"
+ grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap]) | unique }}"
+ with_items: "{{ groups.get(grafana_server_group_name, []) }}"
when:
- groups.get(grafana_server_group_name, []) | length > 0
- ip_version == 'ipv6'
- dashboard_enabled | bool
- - inventory_hostname not in groups[grafana_server_group_name]