How do I delete all files under a directory?
--
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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/65531941-f099-417e-b5e6-3f26f0c96240n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CADBoQTpaj8C9-vtQbfAFh4rGy-Y%3Duo%3DdqJZUr%3D70G-zKheMj-Q%40mail.gmail.com.
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/0LPtwD5c2Yw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BjXPxi0zOg0fdpYT4N4uRPjJVuazzX_m53gcY%2B-Rr1nyq_gTw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAP4UftRgUy7KbJkemG_TOtAVS3otzBpAwdNRoB_ATe2B%2B0c-Sg%40mail.gmail.com.
- hosts: all
tasks:
- name: Ansible delete files examples
find:
paths: /home/mdtutorials2/findmodule/examples
patterns: "*.log"
age: "100d"
recurse: yes
register: files_to_delete
- name: Ansible delete file glob
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ files_to_delete.files }}"
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BjXPxhuKLJuN6aySjNnf3FPRoz2DucGCw5xoP2kxKTdtpNF0A%40mail.gmail.com.