The shell wildcard expansion of non-existing paths fails on zsh making
the whole script fail. We can use file module with with_fileglob to
alleviate the problem instead.
Signed-off-by: Boris Ranto <branto@redhat.com>
failed_when: check_for_running_ceph.rc == 0
- name: remove ceph systemd unit files
- shell: rm -rf /etc/systemd/system/ceph*
+ file:
+ path: "{{ item }}"
+ state: absent
+ with_fileglob: /etc/systemd/system/ceph*
changed_when: false
when: ansible_service_mgr == 'systemd'