/etc/ansible/roles/ceph-ansible/roles/ceph-handler/handlers/main.yml
---
- name: handlers
  when:
     - not rolling_update | bool
     - not docker2podman | default(False) | bool
  block:
    - name: update apt cache
      apt:
        update-cache: yes
      when: ansible_os_family == 'Debian'
      register: result
      until: result is succeeded

    - name: mons handler
      include_tasks: handler_mons.yml
      when: mon_group_name in group_names
      listen: "restart ceph mons"

    - name: osds handler
      include_tasks: handler_osds.yml
      when: osd_group_name in group_names
      listen: "restart ceph osds"

    - name: mdss handler
      include_tasks: handler_mdss.yml
      when: mds_group_name in group_names
      listen: "restart ceph mdss"

    - name: rgws handler
      include_tasks: handler_rgws.yml
      when: rgw_group_name in group_names
      listen: "restart ceph rgws"

    - name: nfss handler
      include_tasks: handler_nfss.yml
      when: nfs_group_name in group_names
      listen: "restart ceph nfss"

    - name: rbdmirrors handler
      include_tasks: handler_rbdmirrors.yml
      when: rbdmirror_group_name in group_names
      listen: "restart ceph rbdmirrors"

    - name: mgrs handler
      include_tasks: handler_mgrs.yml
      when: mgr_group_name in group_names
      listen: "restart ceph mgrs"

    - name: tcmu-runner handler
      include_tasks: handler_tcmu_runner.yml
      when: iscsi_gw_group_name in group_names
      listen: "restart ceph tcmu-runner"

    - name: rbd-target-api and rbd-target-gw handler
      include_tasks: handler_rbd_target_api_gw.yml
      when: iscsi_gw_group_name in group_names
      listen: "restart ceph rbd-target-api-gw"