An Ansible role to compact a target machine's disk for export as a virtual machine image.
- [Windows] Clean WinSXS folder and remove package files for uninstalled features
- [Windows] Remove temporary files
- [Windows] Download+Run+Delete UltraDefrag on all hard drives
- [Windows] zero free space using SDelete on all hard drives
This role requires the [community.windows](https://galaxy.ansible.com/community/windows)
collection.
Variable | Default | Comments |
---|---|---|
remove_packages |
true |
Whether to remove package files for uninstalled features (Windows) |
temporary_files |
see below | A list of directories to clear out. |
temporary_files:
- "{{ ansible_env.LOCALAPPDATA }}\\Temp\\*"
- "{{ ansible_env.SystemRoot }}\\Temp\\*"
- "{{ ansible_env.SystemRoot }}\\Logs\\*"
- "{{ ansible_env.SystemRoot }}\\Panther\\*"
- "{{ ansible_env.SystemRoot }}\\WinSxS\\ManifestCache\\*"
- "{{ ansible_env.SystemRoot }}\\SoftwareDistribution\\Download"