Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_vpnsslweb_hostchecksoftware.py

raw symbols SCIP
1 #!/usr/bin/python
2 from __future__ import absolute_import, division, print_function
3 # Copyright 2019-2024 Fortinet, Inc.
4 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
5
6 __metaclass__ = type
7
8 ANSIBLE_METADATA = {'status': ['preview'],
9 'supported_by': 'community',
10 'metadata_version': '1.1'}
11
12 DOCUMENTATION = '''
13 ---
14 module: fmgr_vpnsslweb_hostchecksoftware
15 short_description: SSL-VPN host check software.
16 version_added: "2.0.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.full_crud
20 options:
21 revision_note:
22 description: The change note that can be specified when an object is created or updated.
23 type: str
24 adom:
25 description: The parameter (adom) in requested url.
26 type: str
27 required: true
28 vpnsslweb_hostchecksoftware:
29 description: The top level parameters set.
30 required: false
31 type: dict
32 suboptions:
33 check_item_list:
34 aliases: ['check-item-list']
35 type: list
36 elements: dict
37 description: Check item list.
38 suboptions:
39 action:
40 type: str
41 description: Action.
42 choices: ['deny', 'require']
43 id:
44 type: int
45 description: ID
46 md5s:
47 type: raw
48 description: (list) MD5 checksum.
49 target:
50 type: str
51 description: Target.
52 type:
53 type: str
54 description: Type.
55 choices: ['file', 'registry', 'process']
56 version:
57 type: str
58 description: Version.
59 guid:
60 type: str
61 description: Globally unique ID.
62 name:
63 type: str
64 description: Name.
65 required: true
66 os_type:
67 aliases: ['os-type']
68 type: str
69 description: OS type.
70 choices: ['macos', 'windows']
71 type:
72 type: str
73 description: Type.
74 choices: ['av', 'fw']
75 version:
76 type: str
77 description: Version.
78 '''
79
80 EXAMPLES = '''
81 - name: Example playbook (generated based on argument schema)
82 hosts: fortimanagers
83 connection: httpapi
84 gather_facts: false
85 tasks:
86 - name: SSL-VPN host check software.
87 fortinet.fortimanager.fmgr_vpnsslweb_hostchecksoftware:
88 # workspace_locking_adom: <global or your adom name>
89 adom: <your own value>
90 state: present # <value in [present, absent]>
91 vpnsslweb_hostchecksoftware:
92 name: "your value" # Required variable, string
93 # check_item_list:
94 # - action: <value in [deny, require]>
95 # id: <integer>
96 # md5s: <list or string>
97 # target: <string>
98 # type: <value in [file, registry, process]>
99 # version: <string>
100 # guid: <string>
101 # os_type: <value in [macos, windows]>
102 # type: <value in [av, fw]>
103 # version: <string>
104 '''
105
106 RETURN = '''
107 meta:
108 description: The result of the request.
109 type: dict
110 returned: always
111 contains:
112 request_url:
113 description: The full url requested.
114 returned: always
115 type: str
116 sample: /sys/login/user
117 response_code:
118 description: The status of api request.
119 returned: always
120 type: int
121 sample: 0
122 response_data:
123 description: The api response.
124 type: list
125 returned: always
126 response_message:
127 description: The descriptive message of the api response.
128 type: str
129 returned: always
130 sample: OK.
131 system_information:
132 description: The information of the target system.
133 type: dict
134 returned: always
135 rc:
136 description: The status the request.
137 type: int
138 returned: always
139 sample: 0
140 version_check_warning:
141 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
142 type: list
143 returned: complex
144 '''
145 from ansible.module_utils.basic import AnsibleModule
146 from ansible.module_utils.connection import Connection
147 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
148 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
149
150
151 def main():
152 urls_list = [
153 '/pm/config/adom/{adom}/obj/vpn/ssl/web/host-check-software',
154 '/pm/config/global/obj/vpn/ssl/web/host-check-software'
155 ]
156 module_arg_spec = {
157 'adom': {'required': True, 'type': 'str'},
158 'revision_note': {'type': 'str'},
159 'vpnsslweb_hostchecksoftware': {
160 'type': 'dict', 'v_range': [['6.0.0', '']],
161 'options': {
162 'check-item-list': {
163 'type': 'list',
164 'options': {
165 'action': {'choices': ['deny', 'require'], 'type': 'str'},
166 'id': {'type': 'int'},
167 'md5s': {'type': 'raw'},
168 'target': {'type': 'str'},
169 'type': {'choices': ['file', 'registry', 'process'], 'type': 'str'},
170 'version': {'type': 'str'}
171 },
172 'elements': 'dict'
173 },
174 'guid': {'type': 'str'},
175 'name': {'required': True, 'type': 'str'},
176 'os-type': {'choices': ['macos', 'windows'], 'type': 'str'},
177 'type': {'choices': ['av', 'fw'], 'type': 'str'},
178 'version': {'type': 'str'}
179 }
180 }
181 }
182
183 module_option_spec = get_module_arg_spec('full crud')
184 module_arg_spec.update(module_option_spec)
185 check_galaxy_version(module_arg_spec)
186 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'vpnsslweb_hostchecksoftware'),
187 supports_check_mode=True)
188 if not module._socket_path:
189 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
190 connection = Connection(module._socket_path)
191 fmgr = NAPIManager('full crud', module_arg_spec, urls_list,
192 'name', 'data', module, connection)
193 fmgr.process_crud()
194 module.exit_json(meta=module.params)
195
196
197 if __name__ == '__main__':
198 main()