From: Dimitri Savineau Date: Thu, 17 Oct 2019 19:10:59 +0000 (-0400) Subject: Move the dashboard playbook in the main directory X-Git-Tag: v5.0.0alpha1~35 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8426856262d2f33b841b0f756e9a8661c328e0be;p=ceph-ansible.git Move the dashboard playbook in the main directory The [group|host]_vars directories are ignored for the dashboard playbook when the inventory file directory doesn't contain those directories. Closes: #4601 Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1761612 Signed-off-by: Dimitri Savineau --- diff --git a/dashboard.yml b/dashboard.yml new file mode 100644 index 000000000..979ed4927 --- /dev/null +++ b/dashboard.yml @@ -0,0 +1,99 @@ +--- +- hosts: all + gather_facts: false + become: true + pre_tasks: + - name: set ceph node exporter install 'In Progress' + run_once: true + set_stats: + data: + installer_phase_ceph_node_exporter: + status: "In Progress" + start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" + + tasks: + - import_role: + name: ceph-defaults + tags: ['ceph_update_config'] + - import_role: + name: ceph-facts + tags: ['ceph_update_config'] + - import_role: + name: ceph-container-engine + - import_role: + name: ceph-node-exporter + + post_tasks: + - name: set ceph node exporter install 'Complete' + run_once: true + set_stats: + data: + installer_phase_ceph_node_exporter: + status: "Complete" + end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" + +- hosts: "{{ grafana_server_group_name }}" + gather_facts: false + become: true + pre_tasks: + - name: set ceph grafana install 'In Progress' + run_once: true + set_stats: + data: + installer_phase_ceph_grafana: + status: "In Progress" + start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" + + tasks: + - import_role: + name: ceph-defaults + tags: ['ceph_update_config'] + - import_role: + name: ceph-facts + tags: ['ceph_update_config'] + - import_role: + name: ceph-prometheus + - import_role: + name: ceph-grafana + + post_tasks: + - name: set ceph grafana install 'Complete' + run_once: true + set_stats: + data: + installer_phase_ceph_grafana: + status: "Complete" + end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" + +# using groups[] here otherwise it can't fallback to the mon if there's no mgr group. +# adding an additional | default(omit) in case where no monitors are present (external ceph cluster) +- hosts: "{{ groups[mgr_group_name] | default(groups[mon_group_name]) | default(omit) }}" + gather_facts: false + become: true + pre_tasks: + - name: set ceph dashboard install 'In Progress' + run_once: true + set_stats: + data: + installer_phase_ceph_dashboard: + status: "In Progress" + start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" + + tasks: + - import_role: + name: ceph-defaults + tags: ['ceph_update_config'] + - import_role: + name: ceph-facts + tags: ['ceph_update_config'] + - import_role: + name: ceph-dashboard + + post_tasks: + - name: set ceph dashboard install 'Complete' + run_once: true + set_stats: + data: + installer_phase_ceph_dashboard: + status: "Complete" + end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" diff --git a/infrastructure-playbooks/dashboard.yml b/infrastructure-playbooks/dashboard.yml deleted file mode 100644 index 979ed4927..000000000 --- a/infrastructure-playbooks/dashboard.yml +++ /dev/null @@ -1,99 +0,0 @@ ---- -- hosts: all - gather_facts: false - become: true - pre_tasks: - - name: set ceph node exporter install 'In Progress' - run_once: true - set_stats: - data: - installer_phase_ceph_node_exporter: - status: "In Progress" - start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" - - tasks: - - import_role: - name: ceph-defaults - tags: ['ceph_update_config'] - - import_role: - name: ceph-facts - tags: ['ceph_update_config'] - - import_role: - name: ceph-container-engine - - import_role: - name: ceph-node-exporter - - post_tasks: - - name: set ceph node exporter install 'Complete' - run_once: true - set_stats: - data: - installer_phase_ceph_node_exporter: - status: "Complete" - end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" - -- hosts: "{{ grafana_server_group_name }}" - gather_facts: false - become: true - pre_tasks: - - name: set ceph grafana install 'In Progress' - run_once: true - set_stats: - data: - installer_phase_ceph_grafana: - status: "In Progress" - start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" - - tasks: - - import_role: - name: ceph-defaults - tags: ['ceph_update_config'] - - import_role: - name: ceph-facts - tags: ['ceph_update_config'] - - import_role: - name: ceph-prometheus - - import_role: - name: ceph-grafana - - post_tasks: - - name: set ceph grafana install 'Complete' - run_once: true - set_stats: - data: - installer_phase_ceph_grafana: - status: "Complete" - end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" - -# using groups[] here otherwise it can't fallback to the mon if there's no mgr group. -# adding an additional | default(omit) in case where no monitors are present (external ceph cluster) -- hosts: "{{ groups[mgr_group_name] | default(groups[mon_group_name]) | default(omit) }}" - gather_facts: false - become: true - pre_tasks: - - name: set ceph dashboard install 'In Progress' - run_once: true - set_stats: - data: - installer_phase_ceph_dashboard: - status: "In Progress" - start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" - - tasks: - - import_role: - name: ceph-defaults - tags: ['ceph_update_config'] - - import_role: - name: ceph-facts - tags: ['ceph_update_config'] - - import_role: - name: ceph-dashboard - - post_tasks: - - name: set ceph dashboard install 'Complete' - run_once: true - set_stats: - data: - installer_phase_ceph_dashboard: - status: "Complete" - end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" diff --git a/site-container.yml.sample b/site-container.yml.sample index 6c6e4af7e..301ecf83a 100644 --- a/site-container.yml.sample +++ b/site-container.yml.sample @@ -442,7 +442,7 @@ run_once: true when: not ceph_status.failed -- import_playbook: infrastructure-playbooks/dashboard.yml +- import_playbook: dashboard.yml when: - dashboard_enabled | bool - groups.get(grafana_server_group_name, []) | length > 0 diff --git a/site.yml.sample b/site.yml.sample index 6c0c1d345..cd2847cf8 100644 --- a/site.yml.sample +++ b/site.yml.sample @@ -456,7 +456,7 @@ run_once: true when: not ceph_status.failed -- import_playbook: infrastructure-playbooks/dashboard.yml +- import_playbook: dashboard.yml when: - dashboard_enabled | bool - groups.get(grafana_server_group_name, []) | length > 0