If you need to delete files and folders in a directory using Ansible, then you can do the following:
- name: Delete content & entire directory
file:
state: absent
path: /some/directory/path/
If you need to delete files and folders in a directory using Ansible, then you can do the following:
- name: Delete content & entire directory
file:
state: absent
path: /some/directory/path/