diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 07373efea..c5f5a13e4 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -756,6 +756,8 @@ dummy: #dashboard_rgw_api_no_ssl_verify: False #dashboard_frontend_vip: '' #node_exporter_container_image: "prom/node-exporter:v0.17.0" +#prometheus_frontend_vip: '' +#alertmanager_frontend_vip: '' #node_exporter_port: 9100 #grafana_admin_user: admin # This variable must be set with a strong custom password when dashboard_enabled is True diff --git a/group_vars/nfss.yml.sample b/group_vars/nfss.yml.sample index 10d7a5f8d..47ba271b6 100644 --- a/group_vars/nfss.yml.sample +++ b/group_vars/nfss.yml.sample @@ -140,3 +140,4 @@ dummy: #ceph_docker_image_tag: latest #ceph_nfs_docker_extra_env: #ceph_config_keys: [] # DON'T TOUCH ME + diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index c2146ba14..5642c954b 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -756,6 +756,8 @@ ceph_docker_registry_auth: true #dashboard_rgw_api_no_ssl_verify: False #dashboard_frontend_vip: '' node_exporter_container_image: registry.redhat.io/openshift4/ose-prometheus-node-exporter:v4.6 +#prometheus_frontend_vip: '' +#alertmanager_frontend_vip: '' #node_exporter_port: 9100 #grafana_admin_user: admin # This variable must be set with a strong custom password when dashboard_enabled is True diff --git a/roles/ceph-dashboard/tasks/configure_dashboard.yml b/roles/ceph-dashboard/tasks/configure_dashboard.yml index dd6aaa983..2099a4320 100644 --- a/roles/ceph-dashboard/tasks/configure_dashboard.yml +++ b/roles/ceph-dashboard/tasks/configure_dashboard.yml @@ -254,12 +254,26 @@ vars: grafana_server_addr: '{{ item }}' -- name: config grafana api url vip - command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-url {{ dashboard_protocol }}://{{ dashboard_frontend_vip }}:{{ grafana_port }}" - delegate_to: "{{ groups[mon_group_name][0] }}" +- name: config monitoring api url vip run_once: true - changed_when: false - when: dashboard_frontend_vip is defined and dashboard_frontend_vip |length > 0 + block: + - name: config grafana api url vip + command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-url {{ dashboard_protocol }}://{{ dashboard_frontend_vip }}:{{ grafana_port }}" + delegate_to: "{{ groups[mon_group_name][0] }}" + changed_when: false + when: dashboard_frontend_vip is defined and dashboard_frontend_vip | length > 0 + + - name: config alertmanager api url + command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-alertmanager-api-host {{ dashboard_protocol }}://{{ alertmanager_frontend_vip }}:{{ alertmanager_port }}" + delegate_to: "{{ groups[mon_group_name][0] }}" + changed_when: false + when: alertmanager_frontend_vip is defined and alertmanager_frontend_vip | length > 0 + + - name: config prometheus api url + command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-prometheus-api-host {{ dashboard_protocol }}://{{ prometheus_frontend_vip }}:{{ prometheus_port }}" + delegate_to: "{{ groups[mon_group_name][0] }}" + changed_when: false + when: prometheus_frontend_vip is defined and prometheus_frontend_vip | length > 0 - name: dashboard object gateway management frontend when: groups.get(rgw_group_name, []) | length > 0 diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index fbeab3d80..191c4127e 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -748,6 +748,8 @@ dashboard_rgw_api_admin_resource: '' dashboard_rgw_api_no_ssl_verify: False dashboard_frontend_vip: '' node_exporter_container_image: "prom/node-exporter:v0.17.0" +prometheus_frontend_vip: '' +alertmanager_frontend_vip: '' node_exporter_port: 9100 grafana_admin_user: admin # This variable must be set with a strong custom password when dashboard_enabled is True