From 4c6ec1dccb994dbd25ec22919f4964bb9b9db8f5 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Fri, 2 Aug 2019 13:35:22 -0400 Subject: [PATCH] mgr/dashboard: Fix grafana/prometheus url config When configuring grafana/prometheus embed in the mgr/dashboard, we need to use the address of the grafana-server node and not the current hostname because mgr/dashboard and grafana/prometheus could be present on different hosts. We should instead rely on the grafana_server_addr variable and remove the dashboard_url. Signed-off-by: Dimitri Savineau --- group_vars/all.yml.sample | 1 - group_vars/rhcs.yml.sample | 1 - roles/ceph-dashboard/tasks/configure_dashboard.yml | 4 ++-- roles/ceph-defaults/defaults/main.yml | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 06b521f33..701c9f3cb 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -704,7 +704,6 @@ dummy: # Choose http or https # For https, you should set dashboard.crt/key and grafana.crt/key #dashboard_protocol: http -#dashboard_url: "{{ ansible_hostname }}" #dashboard_port: 8443 #dashboard_admin_user: admin #dashboard_admin_password: admin diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index 4c1233f02..f532f615b 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -704,7 +704,6 @@ ceph_docker_registry: "registry.access.redhat.com" # Choose http or https # For https, you should set dashboard.crt/key and grafana.crt/key #dashboard_protocol: http -#dashboard_url: "{{ ansible_hostname }}" #dashboard_port: 8443 #dashboard_admin_user: admin #dashboard_admin_password: admin diff --git a/roles/ceph-dashboard/tasks/configure_dashboard.yml b/roles/ceph-dashboard/tasks/configure_dashboard.yml index d5a112a2f..28ce815f7 100644 --- a/roles/ceph-dashboard/tasks/configure_dashboard.yml +++ b/roles/ceph-dashboard/tasks/configure_dashboard.yml @@ -97,13 +97,13 @@ until: ac_result.rc == 0 - name: set grafana url - command: "{{ container_exec_cmd }} ceph dashboard set-grafana-api-url {{ dashboard_protocol }}://{{ dashboard_url }}:{{ grafana_port }}/" + command: "{{ container_exec_cmd }} ceph 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 alertmanager host - command: "{{ container_exec_cmd }} ceph dashboard set-alertmanager-api-host {{ dashboard_protocol }}://{{ dashboard_url }}:{{ alertmanager_port }}/" + command: "{{ container_exec_cmd }} ceph dashboard set-alertmanager-api-host {{ dashboard_protocol }}://{{ grafana_server_addr }}:{{ alertmanager_port }}/" delegate_to: "{{ groups[mon_group_name][0] }}" run_once: true changed_when: false diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index 1b00994ea..a1e31eaa3 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -696,7 +696,6 @@ dashboard_enabled: True # Choose http or https # For https, you should set dashboard.crt/key and grafana.crt/key dashboard_protocol: http -dashboard_url: "{{ ansible_hostname }}" dashboard_port: 8443 dashboard_admin_user: admin dashboard_admin_password: admin -- 2.39.5