Hi,
Two obvious options would be
a) use shell module with find . -type f -print0 | xargs -0 rm or similar
b) use command module instead of file module as your second task
- name: Delete
command: xargs rm
args:
stdin: "{{ files_to_delete | json_query('files[*].path') |
I want to delete all files and directories in a filesystem.
I have done a playbook with module find and file.
I get a list of files with the module find and then I delete the list with
module file and the option absent.
* - name: Gen list*
*find:*
* paths: "{{fs1}}"*
* recurse: