]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
dashboard: use dedicated group only
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 25 Jul 2019 17:08:22 +0000 (19:08 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 29 Jul 2019 13:46:58 +0000 (15:46 +0200)
There's no need to add complexity and trying to fallback on other group.
Let's deploy dashboard on all nodes present in grafana-server group.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit d67230b2a26b40651c1c1dbee68a92b0e851f3d5)

group_vars/all.yml.sample
group_vars/rhcs.yml.sample
infrastructure-playbooks/dashboard.yml
roles/ceph-dashboard/tasks/configure_dashboard.yml
roles/ceph-defaults/defaults/main.yml
roles/ceph-facts/tasks/facts.yml

index ab26caa9ef37eabdb21f41b467faf037b217d7e8..df680253ec62682da85fe01a65198612dc703475 100644 (file)
@@ -704,6 +704,7 @@ 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
index 2442a5335ede9010cd1cc40c5bb7d232ac3663d6..893ec3d5ef1ca0369eaaf5ebac5a5f2648efcbf6 100644 (file)
@@ -704,6 +704,7 @@ 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
index 4963119808d25a75902a6db7a9b017aedc4661f2..dd6c48d6c7a402f5ef50218f929baf318962ee7e 100644 (file)
@@ -32,7 +32,7 @@
             status: "Complete"
             end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
-- hosts: '{{ groups["grafana-server"][0] | default(groups["mgrs"][0]) | default(groups["mons"][0]) | default(omit) }}'
+- hosts: "{{ grafana_server_group_name }}"
   become: true
   pre_tasks:
     - name: set ceph grafana install 'In Progress'
@@ -67,7 +67,7 @@
             status: "Complete"
             end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
-- hosts: '{{ groups["mgrs"][0] | default(groups["mons"][0]) | default(omit) }}'
+- hosts: "{{ grafana_server_group_name }}"
   become: true
   pre_tasks:
     - name: set ceph dashboard install 'In Progress'
index 63a600899be8f2475619066a0516eca7c4702175..7e08dca7d9d0e905b8e39b3d2fb5e5e08a1faa18 100644 (file)
   delegate_to: "{{ groups[mon_group_name][0] }}"
   until: ac_result.rc == 0
 
-- name: set grafana url to grafana instance
-  set_fact:
-    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 }}:{{ grafana_port }}/"
   delegate_to: "{{ groups[mon_group_name][0] }}"
index e72d072713344075715b2bb8dbcb23f9b541376e..d350ca3940411a4c1de8e1e1907bb0cd93a2dd3f 100644 (file)
@@ -696,6 +696,7 @@ 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
index f787abdc7d8074e92675b4ded68a621ea358c4fa..bd86a98b269039d1a313d1913272c401f67e2e35 100644 (file)
 
 - name: set grafana_server_addr fact - ipv4
   set_fact:
-    grafana_server_addr: "{{ (hostvars[groups[grafana_server_group_name][0] if groups.get(grafana_server_group_name, []) | length > 0 else groups[mgr_group_name][0]])['ansible_all_ipv4_addresses'] | ipaddr(public_network) | first }}"
+    grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_all_ipv4_addresses'] | ipaddr(public_network) | first }}"
   when:
-    - (groups.get(grafana_server_group_name, []) | length > 0 or groups.get(mgr_group_name, []) | length > 0)
+    - groups.get(grafana_server_group_name, []) | length > 0
     - ip_version == 'ipv4'
     - dashboard_enabled | bool
 
 - name: set grafana_server_addr fact - ipv6
   set_fact:
-    grafana_server_addr: "{{ (hostvars[groups[grafana_server_group_name][0] if groups.get(grafana_server_group_name, []) | length > 0 else groups[mgr_group_name][0]])['ansible_all_ipv6_addresses'] | ipaddr(public_network) | last | ipwrap }}"
+    grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_all_ipv6_addresses'] | ipaddr(public_network) | last | ipwrap }}"
   when:
-    - (groups.get(grafana_server_group_name, []) | length > 0 or groups.get(mgr_group_name, []) | length > 0)
+    - groups.get(grafana_server_group_name, []) | length > 0
     - ip_version == 'ipv6'
     - dashboard_enabled | bool