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 <dsavinea@redhat.com>
pull/4315/head
Dimitri Savineau 2019-08-02 13:35:22 -04:00 committed by Guillaume Abrioux
parent 16939eff9e
commit 4c6ec1dccb
4 changed files with 2 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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