From 2c9cd9d9e758f7ed2525643f33fe1427d1a857cd Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 12 Jun 2019 08:31:47 +0200 Subject: [PATCH] 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 --- roles/ceph-dashboard/tasks/configure_dashboard.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/roles/ceph-dashboard/tasks/configure_dashboard.yml b/roles/ceph-dashboard/tasks/configure_dashboard.yml index 7230a07b0..1be5c60a9 100644 --- a/roles/ceph-dashboard/tasks/configure_dashboard.yml +++ b/roles/ceph-dashboard/tasks/configure_dashboard.yml @@ -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/"