- This Ansible module ensures that a or more folders are empty.
Parameter | Choices/Defaults | Comments |
---|---|---|
path string / required |
A path to one or more locations of the items being removed. | |
exclude string |
An item or items that this module excludes in the operation. |
---
- name: test the win_directory_empty module
hosts: all
gather_facts: false
roles:
- win_directory_empty
tasks:
- name: Ensure the temp folder is empty
win_directory_empty:
path: 'c:\windows\temp'
- name: Ensure the temp folder is empty
win_directory_empty:
path:
- 'c:\windows\temp'
- 'c:\temp'
exclude: '*1*'
- name: Ensure the temp folder is empty
win_directory_empty:
path:
- 'c:\windows\temp'
- 'c:\temp'
exclude:
- 'vmware-*.log'
- '*2*'
- Stéphane Bilqué (@sbilque) Informatique CDC
This project is licensed under the Apache 2.0 License.
See LICENSE to see the full text.