Debian Codegraph @

ansible_collections/community/windows/plugins/modules/win_zip.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Copyright: (c) 2021, Kento Yagisawa <[email protected]>
5 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 DOCUMENTATION = r'''
8 ---
9 module: win_zip
10 short_description: Compress file or directory as zip archive on the Windows node
11 description:
12 - Compress file or directory as zip archive.
13 - For non-Windows targets, use the M(community.general.archive) module instead.
14 notes:
15 - The filenames in the zip are encoded using UTF-8.
16 requirements:
17 - .NET Framework 4.5 or later
18 options:
19 src:
20 description:
21 - File or directory path to be zipped (provide absolute path on the target node).
22 - When a directory path the directory is zipped as the root entry in the archive.
23 - Specify C(\*) to the end of I(src) to zip the contents of the directory and not the directory itself.
24 type: str
25 required: yes
26 dest:
27 description:
28 - Destination path of zip file (provide absolute path of zip file on the target node).
29 type: path
30 required: yes
31 seealso:
32 - module: community.general.archive
33 author:
34 - Kento Yagisawa (@hiyoko_taisa)
35 '''
36
37 EXAMPLES = r'''
38 - name: Compress a file
39 community.windows.win_zip:
40 src: C:\Users\hiyoko\log.txt
41 dest: C:\Users\hiyoko\log.zip
42
43 - name: Compress a directory as the root of the archive
44 community.windows.win_zip:
45 src: C:\Users\hiyoko\log
46 dest: C:\Users\hiyoko\log.zip
47
48 - name: Compress the directories contents
49 community.windows.win_zip:
50 src: C:\Users\hiyoko\log\*
51 dest: C:\Users\hiyoko\log.zip
52 '''