]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
purge-cluster: remove usage of `with_fileglob` 2185/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 16 Nov 2017 10:49:18 +0000 (11:49 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 21 Nov 2017 07:24:11 +0000 (08:24 +0100)
`with_fileglob` loops over files on the machine where ansible-playbook
is being run.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
infrastructure-playbooks/purge-cluster.yml

index 0d4db11497540a194486de1fd3f0de4c9d579d55..b97916f821d86802460877f16c90733e7d92123b 100644 (file)
     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'