Alters the compression of files and directories on NTFS partitions.
- This module sets the compressed attribute for files and directories on a filesystem that supports it like NTFS.
- NTFS compression can be used to save disk space.
Note
- :ref:`community.windows.win_file_compression <community.windows.win_file_compression_module>` sets the file system's compression state, it does not create a zip archive file.
- For more about NTFS Compression, see http://www.ntfs.com/ntfs-compressed.htm
- name: Compress log files directory
community.windows.win_file_compression:
path: C:\Logs
state: present
- name: Decompress log files directory
community.windows.win_file_compression:
path: C:\Logs
state: absent
- name: Compress reports directory and all subdirectories
community.windows.win_file_compression:
path: C:\business\reports
state: present
recurse: yes
# This will only check C:\business\reports for the compressed state
# If C:\business\reports is compressed, it will not make a change
# even if one of the child items is uncompressed
- name: Compress reports directory and all subdirectories (quick)
community.windows.win_file_compression:
path: C:\business\reports
compressed: yes
recurse: yes
force: no
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
rc
integer
|
always |
The return code of the compress/uncompress operation.
If no changes are made or the operation is successful, rc is 0.
|
- Micah Hunsberger (@mhunsber)