]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Config the monitoring stack components api urls using a VIP
authorFrancesco Pantano <fpantano@redhat.com>
Fri, 9 Apr 2021 15:16:03 +0000 (17:16 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 16 Apr 2021 06:33:16 +0000 (08:33 +0200)
When dashboard_frontend_vip is provided, all the services should be
configured using the related VIP. A new VIP variable is added for
both prometheus and alertmanager: we're already able to properly
config the grafana vip using dashboard_frontend_vip variable.
This change adds the same variable for both prometheus and
alertmanager.

Signed-off-by: Francesco Pantano <fpantano@redhat.com>
(cherry picked from commit 441651638d883b73c960363becae54096c8cee85)

group_vars/all.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-dashboard/tasks/configure_dashboard.yml
roles/ceph-defaults/defaults/main.yml

index 0a06b4b71edba8dce1e223afebe41429c056081a..7f4b393498d3d1a2fcfd1a6fc19d9d045be31287 100644 (file)
@@ -664,6 +664,8 @@ dummy:
 #dashboard_rgw_api_admin_resource: ''
 #dashboard_rgw_api_no_ssl_verify: False
 #dashboard_frontend_vip: ''
+#alertmanager_frontend_vip: ''
+#prometheus_frontend_vip: ''
 #node_exporter_container_image: "docker.io/prom/node-exporter:v0.17.0"
 #node_exporter_port: 9100
 #grafana_admin_user: admin
index 53999471825a570c9d7837b0f94d7b587372a699..019d63bbd0166eb0517c7f6fae460e3d9bd3f0f8 100644 (file)
@@ -664,6 +664,8 @@ containerized_deployment: true
 #dashboard_rgw_api_admin_resource: ''
 #dashboard_rgw_api_no_ssl_verify: False
 #dashboard_frontend_vip: ''
+#prometheus_frontend_vip: ''
+#alertmanager_frontend_vip: ''
 node_exporter_container_image: registry.redhat.io/openshift4/ose-prometheus-node-exporter:v4.6
 #node_exporter_port: 9100
 #grafana_admin_user: admin
index ac5c934cd5722f966d3c5f3fb06c721277be4a23..38ed17605a16bf181cde7f2ee7d00d743d189098 100644 (file)
   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
index b8d7025cd33637717d2ab1f6abfe726ed1dc1523..08fb9813f5f103ba3e12839507726f44f01f86d7 100644 (file)
@@ -656,6 +656,8 @@ dashboard_rgw_api_user_id: ceph-dashboard
 dashboard_rgw_api_admin_resource: ''
 dashboard_rgw_api_no_ssl_verify: False
 dashboard_frontend_vip: ''
+prometheus_frontend_vip: ''
+alertmanager_frontend_vip: ''
 node_exporter_container_image: "docker.io/prom/node-exporter:v0.17.0"
 node_exporter_port: 9100
 grafana_admin_user: admin