dashboard: fix dashboard_url setting

This setting must be set to something resolvable.

See: ceph/ceph-ansible/issues/4085 for details

Fixes: #4085

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 2c9cd9d9e7)
pull/4099/head
Guillaume Abrioux 2019-06-12 08:31:47 +02:00 committed by Dimitri Savineau
parent 3815add534
commit dfdaef4158
1 changed files with 1 additions and 7 deletions

View File

@ -92,13 +92,7 @@
- name: set grafana url to grafana instance - name: set grafana url to grafana instance
set_fact: set_fact:
dashboard_url: "{{ groups[grafana_server_group_name][0] }}" dashboard_url: "{{ hostvars[(groups[grafana_server_group_name][0] | default(groups[mgr_group_name][0]) | default(groups[mon_group_name][0]))]['ansible_hostname'] }}"
when: "{{ groups.grafana_server_group_name is defined and groups[grafana_server_group_name] | length > 0 }}"
- name: set grafana url to mon
set_fact:
dashboard_url: "{{ groups[mon_group_name][0] }}"
when: "{{ groups.grafana_server_group_name is not defined or groups[grafana_server_group_name] | length == 0 }}"
- name: set grafana url - name: set grafana url
command: "{{ container_exec_cmd }} ceph dashboard set-grafana-api-url {{ dashboard_protocol }}://{{ dashboard_url }}:3000/" command: "{{ container_exec_cmd }} ceph dashboard set-grafana-api-url {{ dashboard_protocol }}://{{ dashboard_url }}:3000/"