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

92 lines
2.6 KiB
YAML

---
- 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: make tempdir for scripts
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"
- "restart ceph tcmu-runner"
- "restart ceph rbd-target-api-gw"
register: tmpdirpath
when: tmpdirpath is not defined or tmpdirpath.path is not defined or tmpdirpath.state=="absent"
- 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"
- name: remove tempdir for scripts
file:
path: "{{ tmpdirpath.path }}"
state: absent
listen:
- "restart ceph mons"
- "restart ceph osds"
- "restart ceph mdss"
- "restart ceph rgws"
- "restart ceph nfss"
- "restart ceph rbdmirrors"
- "restart ceph mgrs"
- "restart ceph tcmu-runner"
- "restart ceph rbd-target-api-gw"
register: tmpdirpath
when: tmpdirpath is defined