2018-07-27 22:56:09 +08:00
|
|
|
---
|
|
|
|
- name: include check_running_cluster.yml
|
2019-08-23 02:29:40 +08:00
|
|
|
include: check_running_cluster.yml
|
2019-10-03 19:52:11 +08:00
|
|
|
|
|
|
|
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
|
|
|
|
- name: set_fact handler_mon_status
|
|
|
|
set_fact:
|
2020-10-06 20:58:46 +08:00
|
|
|
handler_mon_status: "{{ 0 in (mon_socket.results | map(attribute='rc') | list) if not containerized_deployment | bool else (ceph_mon_container_stat.get('rc') == 0 and ceph_mon_container_stat.get('stdout_lines', []) | length != 0) }}"
|
2019-10-03 19:52:11 +08:00
|
|
|
when: inventory_hostname in groups.get(mon_group_name, [])
|
|
|
|
|
|
|
|
- name: set_fact handler_osd_status
|
|
|
|
set_fact:
|
2020-10-06 20:58:46 +08:00
|
|
|
handler_osd_status: "{{ 0 in (osd_socket.results | map(attribute='rc') | list) if not containerized_deployment | bool else (ceph_osd_container_stat.get('rc') == 0 and ceph_osd_container_stat.get('stdout_lines', []) | length != 0) }}"
|
2019-10-03 19:52:11 +08:00
|
|
|
when: inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
|
|
|
|
- name: set_fact handler_mds_status
|
|
|
|
set_fact:
|
2020-10-06 20:58:46 +08:00
|
|
|
handler_mds_status: "{{ 0 in (mds_socket.results | map(attribute='rc') | list) if not containerized_deployment | bool else (ceph_mds_container_stat.get('rc') == 0 and ceph_mds_container_stat.get('stdout_lines', []) | length != 0) }}"
|
2019-10-03 19:52:11 +08:00
|
|
|
when: inventory_hostname in groups.get(mds_group_name, [])
|
|
|
|
|
|
|
|
- name: set_fact handler_rgw_status
|
|
|
|
set_fact:
|
2020-10-06 20:58:46 +08:00
|
|
|
handler_rgw_status: "{{ 0 in (rgw_socket.results | map(attribute='rc') | list) if not containerized_deployment | bool else (ceph_rgw_container_stat.get('rc') == 0 and ceph_rgw_container_stat.get('stdout_lines', []) | length != 0) }}"
|
2019-10-03 19:52:11 +08:00
|
|
|
when: inventory_hostname in groups.get(rgw_group_name, [])
|
|
|
|
|
|
|
|
- name: set_fact handler_nfs_status
|
|
|
|
set_fact:
|
2020-10-06 20:58:46 +08:00
|
|
|
handler_nfs_status: "{{ (nfs_process.get('rc') == 0) if not containerized_deployment | bool else (ceph_nfs_container_stat.get('rc') == 0 and ceph_nfs_container_stat.get('stdout_lines', []) | length != 0) }}"
|
2019-10-03 19:52:11 +08:00
|
|
|
when: inventory_hostname in groups.get(nfs_group_name, [])
|
|
|
|
|
|
|
|
- name: set_fact handler_rbd_status
|
|
|
|
set_fact:
|
2020-10-06 20:58:46 +08:00
|
|
|
handler_rbd_mirror_status: "{{ 0 in (rbd_mirror_socket.results | map(attribute='rc') | list) if not containerized_deployment | bool else (ceph_rbd_mirror_container_stat.get('rc') == 0 and ceph_rbd_mirror_container_stat.get('stdout_lines', []) | length != 0) }}"
|
2019-10-03 19:52:11 +08:00
|
|
|
when: inventory_hostname in groups.get(rbdmirror_group_name, [])
|
|
|
|
|
|
|
|
- name: set_fact handler_mgr_status
|
|
|
|
set_fact:
|
2020-10-06 20:58:46 +08:00
|
|
|
handler_mgr_status: "{{ 0 in (mgr_socket.results | map(attribute='rc') | list) if not containerized_deployment | bool else (ceph_mgr_container_stat.get('rc') == 0 and ceph_mgr_container_stat.get('stdout_lines', []) | length != 0) }}"
|
2020-07-03 16:21:49 +08:00
|
|
|
when: inventory_hostname in groups.get(mgr_group_name, [])
|
|
|
|
|
|
|
|
- name: set_fact handler_crash_status
|
|
|
|
set_fact:
|
|
|
|
handler_crash_status: "{{ crash_process.get('rc') == 0 if not containerized_deployment | bool else (ceph_crash_container_stat.get('rc') == 0 and ceph_crash_container_stat.get('stdout_lines', []) | length != 0) }}"
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mon_group_name, [])
|
|
|
|
or inventory_hostname in groups.get(mgr_group_name, [])
|
|
|
|
or inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
or inventory_hostname in groups.get(mds_group_name, [])
|
|
|
|
or inventory_hostname in groups.get(rgw_group_name, [])
|
2020-09-23 23:47:20 +08:00
|
|
|
or inventory_hostname in groups.get(rbdmirror_group_name, [])
|
|
|
|
|
|
|
|
- name: rgw multi-instances related tasks
|
|
|
|
when:
|
2021-04-09 17:02:12 +08:00
|
|
|
- not docker2podman | default(false) | bool
|
2021-06-11 02:09:55 +08:00
|
|
|
- not rolling_update | default(false) | bool
|
2020-09-23 23:47:20 +08:00
|
|
|
- inventory_hostname in groups.get(rgw_group_name, [])
|
|
|
|
- handler_rgw_status | bool
|
|
|
|
block:
|
|
|
|
- name: import_role ceph-config
|
|
|
|
import_role:
|
|
|
|
name: ceph-config
|
|
|
|
|
|
|
|
- name: import_role ceph-rgw
|
|
|
|
import_role:
|
|
|
|
name: ceph-rgw
|
|
|
|
tasks_from: pre_requisite.yml
|
|
|
|
when: not containerized_deployment | bool
|
2021-01-06 17:37:12 +08:00
|
|
|
|
|
|
|
- name: import_role ceph-rgw
|
|
|
|
import_role:
|
|
|
|
name: ceph-rgw
|
|
|
|
tasks_from: multisite.yml
|
2021-01-28 01:36:13 +08:00
|
|
|
when:
|
|
|
|
- rgw_multisite | bool
|
|
|
|
- not multisite_called_from_handler_role | default(False) | bool
|
|
|
|
|
|
|
|
- name: set_fact multisite_called_from_handler_role
|
|
|
|
set_fact:
|
|
|
|
multisite_called_from_handler_role: true
|