community / community.windows / 2.2.0 / module / win_zip Compress file or directory as zip archive on the Windows node Authors: Kento Yagisawa (@hiyoko_taisa)community.windows.win_zip (2.2.0) — module
Install with ansible-galaxy collection install community.windows:==2.2.0
collections: - name: community.windows version: 2.2.0
Compress file or directory as zip archive.
For non-Windows targets, use the M(community.general.archive) module instead.
- name: Compress a file community.windows.win_zip: src: C:\Users\hiyoko\log.txt dest: C:\Users\hiyoko\log.zip
- name: Compress a directory as the root of the archive community.windows.win_zip: src: C:\Users\hiyoko\log dest: C:\Users\hiyoko\log.zip
- name: Compress the directories contents community.windows.win_zip: src: C:\Users\hiyoko\log\* dest: C:\Users\hiyoko\log.zip
src: description: - File or directory path to be zipped (provide absolute path on the target node). - When a directory path the directory is zipped as the root entry in the archive. - Specify C(\*) to the end of I(src) to zip the contents of the directory and not the directory itself. required: true type: str dest: description: - Destination path of zip file (provide absolute path of zip file on the target node). required: true type: path