Debian Codegraph @

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

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Copyright: (c) 2015, Sam Liu <[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_file_version
10 short_description: Get DLL or EXE file build version
11 description:
12 - Get DLL or EXE file build version.
13 notes:
14 - This module will always return no change.
15 options:
16 path:
17 description:
18 - File to get version.
19 - Always provide absolute path.
20 type: path
21 required: yes
22 seealso:
23 - module: ansible.windows.win_file
24 author:
25 - Sam Liu (@SamLiu79)
26 - Mikhail Samodurov (@EasyMoney322)
27 '''
28
29 EXAMPLES = r'''
30 - name: Get acm instance version
31 community.windows.win_file_version:
32 path: C:\Windows\System32\cmd.exe
33 register: exe_file_version
34
35 - debug:
36 msg: '{{ exe_file_version.win_file_version }}'
37 '''
38
39 RETURN = r'''
40 win_file_version:
41 description: dictionary containing all the version data
42 returned: success
43 type: complex
44 contains:
45 file_build_part:
46 description: build number of the file.
47 returned: no error
48 type: str
49 sample: "2"
50 file_major_part:
51 description: the major part of the version number.
52 returned: no error
53 type: str
54 sample: "0"
55 file_minor_part:
56 description: the minor part of the version number of the file.
57 returned: no error
58 type: str
59 sample: "30"
60 file_private_part:
61 description: file private part number.
62 returned: no error
63 type: str
64 sample: "0"
65 file_version:
66 description: File version number.
67 returned: no error
68 type: str
69 sample: "v0.30.2"
70 file_version_raw:
71 description: File version number that may not match the file_version
72 returned: no error
73 type: str
74 sample: "0.30.2.0"
75 version_added: 2.4.0
76 path:
77 description: file path
78 returned: always
79 type: str
80 product_version:
81 description: The version of the product this file is distributed with.
82 returned: no error
83 type: str
84 sample: "0.30.2+b4a594409fc9e79e7c5161763cf1c4328e9c5a5d"
85 '''