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>
pull/4092/head
Guillaume Abrioux 2019-06-12 08:31:47 +02:00
parent d0840217f3
commit 2c9cd9d9e7
1 changed files with 1 additions and 7 deletions

View File

@ -92,13 +92,7 @@
- name: set grafana url to grafana instance
set_fact:
dashboard_url: "{{ groups[grafana_server_group_name][0] }}"
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 }}"
dashboard_url: "{{ hostvars[(groups[grafana_server_group_name][0] | default(groups[mgr_group_name][0]) | default(groups[mon_group_name][0]))]['ansible_hostname'] }}"
- name: set grafana url
command: "{{ container_exec_cmd }} ceph dashboard set-grafana-api-url {{ dashboard_protocol }}://{{ dashboard_url }}:3000/"