--- - name: ensure systemd service override directory exists file: state: directory path: "/etc/systemd/system/ceph-rbd-mirror@.service.d/" when: - ceph_rbd_mirror_systemd_overrides is defined - ansible_service_mgr == 'systemd' - name: add ceph-rbd-mirror systemd service overrides config_template: src: "ceph-rbd-mirror.service.d-overrides.j2" dest: "/etc/systemd/system/ceph-rbd-mirror@.service.d/ceph-rbd-mirror-systemd-overrides.conf" config_overrides: "{{ ceph_rbd_mirror_systemd_overrides | default({}) }}" config_type: "ini" when: - ceph_rbd_mirror_systemd_overrides is defined - ansible_service_mgr == 'systemd' - name: stop and remove the generic rbd-mirror service instance service: name: "ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}" state: stopped enabled: no changed_when: false - name: enable ceph-rbd-mirror.target systemd: name: "ceph-rbd-mirror.target" state: started enabled: yes masked: no changed_when: false - name: start and add the rbd-mirror service instance service: name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }}" state: started enabled: yes masked: no changed_when: false