2014-03-04 02:08:51 +08:00
|
|
|
---
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Handlers
|
2019-12-02 16:47:21 +08:00
|
|
|
when:
|
2024-02-14 18:14:02 +08:00
|
|
|
- not rolling_update | bool
|
|
|
|
- not docker2podman | default(False) | bool
|
2019-03-20 14:46:23 +08:00
|
|
|
block:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Make tempdir for scripts
|
|
|
|
ansible.builtin.tempfile:
|
2019-11-29 01:28:53 +08:00
|
|
|
state: directory
|
|
|
|
prefix: ceph_ansible
|
|
|
|
listen:
|
2024-02-14 18:14:02 +08:00
|
|
|
- "Restart ceph mons"
|
|
|
|
- "Restart ceph osds"
|
|
|
|
- "Restart ceph mdss"
|
|
|
|
- "Restart ceph rgws"
|
|
|
|
- "Restart ceph nfss"
|
|
|
|
- "Restart ceph rbdmirrors"
|
|
|
|
- "Restart ceph mgrs"
|
2019-11-29 01:28:53 +08:00
|
|
|
register: tmpdirpath
|
|
|
|
when: tmpdirpath is not defined or tmpdirpath.path is not defined or tmpdirpath.state=="absent"
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Mons handler
|
|
|
|
ansible.builtin.include_tasks: handler_mons.yml
|
2019-07-09 22:03:26 +08:00
|
|
|
when: mon_group_name in group_names
|
2024-02-14 18:14:02 +08:00
|
|
|
listen: "Restart ceph mons"
|
2019-03-20 14:46:23 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Osds handler
|
|
|
|
ansible.builtin.include_tasks: handler_osds.yml
|
2019-07-09 22:03:26 +08:00
|
|
|
when: osd_group_name in group_names
|
2024-02-14 18:14:02 +08:00
|
|
|
listen: "Restart ceph osds"
|
2019-03-20 14:46:23 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Mdss handler
|
|
|
|
ansible.builtin.include_tasks: handler_mdss.yml
|
2019-04-01 23:46:15 +08:00
|
|
|
when: mds_group_name in group_names
|
2024-02-14 18:14:02 +08:00
|
|
|
listen: "Restart ceph mdss"
|
2019-03-20 14:46:23 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Rgws handler
|
|
|
|
ansible.builtin.include_tasks: handler_rgws.yml
|
2019-04-01 23:46:15 +08:00
|
|
|
when: rgw_group_name in group_names
|
2024-02-14 18:14:02 +08:00
|
|
|
listen: "Restart ceph rgws"
|
2019-03-20 14:46:23 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Nfss handler
|
|
|
|
ansible.builtin.include_tasks: handler_nfss.yml
|
2019-04-01 23:46:15 +08:00
|
|
|
when: nfs_group_name in group_names
|
2024-02-14 18:14:02 +08:00
|
|
|
listen: "Restart ceph nfss"
|
2019-03-20 14:46:23 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Rbdmirrors handler
|
|
|
|
ansible.builtin.include_tasks: handler_rbdmirrors.yml
|
2019-04-01 23:46:15 +08:00
|
|
|
when: rbdmirror_group_name in group_names
|
2024-02-14 18:14:02 +08:00
|
|
|
listen: "Restart ceph rbdmirrors"
|
2019-03-20 14:46:23 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Mgrs handler
|
|
|
|
ansible.builtin.include_tasks: handler_mgrs.yml
|
2019-04-01 23:46:15 +08:00
|
|
|
when: mgr_group_name in group_names
|
2024-02-14 18:14:02 +08:00
|
|
|
listen: "Restart ceph mgrs"
|
2019-03-20 14:46:23 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Ceph crash handler
|
|
|
|
ansible.builtin.include_tasks: handler_crash.yml
|
|
|
|
listen: "Restart ceph crash"
|
2020-07-22 03:14:30 +08:00
|
|
|
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, [])
|
|
|
|
or inventory_hostname in groups.get(rbdmirror_group_name, [])
|
2020-07-03 16:21:49 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Remove tempdir for scripts
|
|
|
|
ansible.builtin.file:
|
2019-11-29 01:28:53 +08:00
|
|
|
path: "{{ tmpdirpath.path }}"
|
|
|
|
state: absent
|
|
|
|
listen:
|
2024-02-14 18:14:02 +08:00
|
|
|
- "Restart ceph mons"
|
|
|
|
- "Restart ceph osds"
|
|
|
|
- "Restart ceph mdss"
|
|
|
|
- "Restart ceph rgws"
|
|
|
|
- "Restart ceph nfss"
|
|
|
|
- "Restart ceph rbdmirrors"
|
|
|
|
- "Restart ceph mgrs"
|
2019-11-29 01:28:53 +08:00
|
|
|
register: tmpdirpath
|
2024-02-16 18:30:07 +08:00
|
|
|
when:
|
|
|
|
- tmpdirpath.path is defined
|
|
|
|
- not _crash_handler_called | default(false) | bool
|
|
|
|
- not _mds_handler_called | default(false) | bool
|
|
|
|
- not _mgr_handler_called | default(false) | bool
|
|
|
|
- not _mon_handler_called | default(false) | bool
|
|
|
|
- not _nfs_handler_called | default(false) | bool
|
|
|
|
- not _osd_handler_called | default(false) | bool
|
|
|
|
- not _rbdmirror_handler_called | default(false) | bool
|
|
|
|
- not _rgw_handler_called | default(false) | bool
|