This could get unwieldy quickly but is there some reason why you can't 
use...

- name: remove files
  file: path={{ item }} state=absent
  with_items:
    - '/root/testing'
    - '/root/testing2'
    - '/home/user/testfile'
    - '/home/user/testfile2'
 
This has the big advantage over the commands version that it is actually 
idempotent.  If it has to remove the files it will, but if they are already 
gone it will report that the task was 'OK'.  Your version might well report 
failed if the file no longer exists.

Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2ede34ce-d578-40b2-895a-307b37168194%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to