.. _community.windows.win_zip_module: ************************* community.windows.win_zip ************************* **Compress file or directory as zip archive on the Windows node** .. contents:: :local: :depth: 1 Synopsis -------- - Compress file or directory as zip archive. - For non-Windows targets, use the :ref:`ansible.builtin.archive ` module instead. Requirements ------------ The below requirements are needed on the host that executes this module. - .NET Framework 4.5 or later Parameters ---------- .. raw:: html
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.

Notes ----- .. note:: - The filenames in the zip are encoded using UTF-8. See Also -------- .. seealso:: :ref:`ansible.builtin.archive_module` The official documentation on the **ansible.builtin.archive** module. Examples -------- .. code-block:: yaml - 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 Status ------ Authors ~~~~~~~ - Kento Yagisawa (@hiyoko_taisa)