Note
This plugin is part of the community.windows collection (version 1.7.0).
You might already have this collection installed if you are using the ansible
package. It is not included in ansible-core
. To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.windows
.
To use it in a playbook, specify: community.windows.win_zip
.
The below requirements are needed on the host that executes this module.
Parameter | Choices/Defaults | Comments |
---|---|---|
dest path / required | Destination path of zip file (provide absolute path of zip file on the target node). | |
src string / required | 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 \* to the end of src to zip the contents of the directory and not the directory itself. |
Note
See also
The official documentation on the ansible.builtin.archive module.
- 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
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/windows/win_zip_module.html