Ansible 删除多个文件或目录
- name: Ansible delete file example
file:
path: /etc/delete.conf
state: absent- name: Ansible delete multiple file example
file:
path: "{{ item }}"
state: absent
with_items:
- hello1.txt
- hello2.txt
- hello3.txt- name: Ansible delete directory example
file:
path: removed_files
state: absentLast updated