From 3816a0adc08e89abda7415439ed977018dd2401c Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Thu, 16 Nov 2017 11:49:18 +0100 Subject: [PATCH] purge-cluster: remove usage of `with_fileglob` `with_fileglob` loops over files on the machine where ansible-playbook is being run. Signed-off-by: Guillaume Abrioux (cherry picked from commit 947766e294cf8b18eb551a8093b0bbdca7610858) --- infrastructure-playbooks/purge-cluster.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/infrastructure-playbooks/purge-cluster.yml b/infrastructure-playbooks/purge-cluster.yml index 0d4db1149..b97916f82 100644 --- a/infrastructure-playbooks/purge-cluster.yml +++ b/infrastructure-playbooks/purge-cluster.yml @@ -661,12 +661,18 @@ register: check_for_running_ceph failed_when: check_for_running_ceph.rc == 0 + - name: find ceph systemd unit files to remove + find: + paths: "/etc/systemd/system" + pattern: "ceph*" + register: systemd_files + - name: remove ceph systemd unit files file: - path: "{{ item }}" + path: "{{ item.path }}" state: absent - with_fileglob: /etc/systemd/system/ceph* - changed_when: false + with_items: + - "{{ systemd_files.files }}" when: ansible_service_mgr == 'systemd' -- 2.39.5