]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
dashboard: fix dashboard_url setting
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 12 Jun 2019 06:31:47 +0000 (08:31 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Wed, 12 Jun 2019 21:04:57 +0000 (17:04 -0400)
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 2c9cd9d9e758f7ed2525643f33fe1427d1a857cd)

roles/ceph-dashboard/tasks/configure_dashboard.yml

index 7230a07b03a700e26b48b3b8c1614e4c5e7597f6..1be5c60a9e3c7ecb556e91b713e53dbf94c6d949 100644 (file)
 
 - 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/"