How to Delete Files and Folders in a Directory using Ansible 2022-10-21 35 words - 1 min read If you need to delete files and folders in a directory using Ansible, then you can do the following: 1 2 3 4 - name: Delete content & entire directory file: state: absent path: /some/directory/path/