ceph-ansible/roles/ceph-handler/handlers/main.yml

78 lines
2.7 KiB
YAML

---
- name: Handlers
when:
- not rolling_update | bool
- not docker2podman | default(False) | bool
block:
- name: Make tempdir for scripts
ansible.builtin.tempfile:
state: directory
prefix: ceph_ansible
listen:
- "Restart ceph mons"
- "Restart ceph osds"
- "Restart ceph mdss"
- "Restart ceph rgws"
- "Restart ceph nfss"
- "Restart ceph rbdmirrors"
- "Restart ceph mgrs"
register: tmpdirpath
when: tmpdirpath is not defined or tmpdirpath.path is not defined or tmpdirpath.state=="absent"
- name: Mons handler
ansible.builtin.include_tasks: handler_mons.yml
when: mon_group_name in group_names
listen: "Restart ceph mons"
- name: Osds handler
ansible.builtin.include_tasks: handler_osds.yml
when: osd_group_name in group_names
listen: "Restart ceph osds"
- name: Mdss handler
ansible.builtin.include_tasks: handler_mdss.yml
when: mds_group_name in group_names
listen: "Restart ceph mdss"
- name: Rgws handler
ansible.builtin.include_tasks: handler_rgws.yml
when: rgw_group_name in group_names
listen: "Restart ceph rgws"
- name: Nfss handler
ansible.builtin.include_tasks: handler_nfss.yml
when: nfs_group_name in group_names
listen: "Restart ceph nfss"
- name: Rbdmirrors handler
ansible.builtin.include_tasks: handler_rbdmirrors.yml
when: rbdmirror_group_name in group_names
listen: "Restart ceph rbdmirrors"
- name: Mgrs handler
ansible.builtin.include_tasks: handler_mgrs.yml
when: mgr_group_name in group_names
listen: "Restart ceph mgrs"
- name: Ceph crash handler
ansible.builtin.include_tasks: handler_crash.yml
listen: "Restart ceph crash"
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, [])
- name: Ceph exporter handler
ansible.builtin.include_tasks: handler_exporter.yml
listen: "Restart ceph exporter"
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, [])