xxxxxxxxxx
- name: Delete content & directory
file:
state: absent
path: /home/mydata/web/
xxxxxxxxxx
- name: remove files and directories
file:
state: "{{ item }}"
path: "/srv/deleteme/"
owner: 1000 # set your owner, group, and mode accordingly
group: 1000
mode: '0777'
with_items:
- absent
- directory