Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_connector.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_system_connector
15 short_description: Configure connector.
16 version_added: "2.0.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.partial_crud
20 options:
21 system_connector:
22 description: The top level parameters set.
23 required: false
24 type: dict
25 suboptions:
26 fsso_refresh_interval:
27 aliases: ['fsso-refresh-interval']
28 type: int
29 description: FSSO refresh interval
30 fsso_sess_timeout:
31 aliases: ['fsso-sess-timeout']
32 type: int
33 description: FSSO session timeout
34 px_refresh_interval:
35 aliases: ['px-refresh-interval']
36 type: int
37 description: PxGrid refresh interval
38 px_svr_timeout:
39 aliases: ['px-svr-timeout']
40 type: int
41 description: PxGrid server timeout
42 conn_refresh_interval:
43 aliases: ['conn-refresh-interval']
44 type: int
45 description: Connector refresh interval
46 cloud_orchest_refresh_interval:
47 aliases: ['cloud-orchest-refresh-interval']
48 type: int
49 description: Cloud Orchestration refresh interval
50 faznotify_msg_queue_max:
51 aliases: ['faznotify-msg-queue-max']
52 type: int
53 description: Faznotify max queued message per connector
54 faznotify_msg_timeout:
55 aliases: ['faznotify-msg-timeout']
56 type: int
57 description: Faznotify message timeout
58 conn_ssl_protocol:
59 aliases: ['conn-ssl-protocol']
60 type: str
61 description:
62 - set the lowest SSL protocol version for connector.
63 - follow-global-ssl-protocol - Follow system.
64 - sslv3 - set SSLv3 as the lowest version.
65 - tlsv1.
66 - tlsv1.
67 - tlsv1.
68 - tlsv1.
69 choices: ['follow-global-ssl-protocol', 'sslv3', 'tlsv1.0', 'tlsv1.1', 'tlsv1.2',
70 'tlsv1.3']
71 '''
72
73 EXAMPLES = '''
74 - name: Example playbook (generated based on argument schema)
75 hosts: fortimanagers
76 connection: httpapi
77 gather_facts: false
78 tasks:
79 - name: Configure connector.
80 fortinet.fortimanager.fmgr_system_connector:
81 # workspace_locking_adom: <global or your adom name>
82 system_connector:
83 # fsso_refresh_interval: <integer>
84 # fsso_sess_timeout: <integer>
85 # px_refresh_interval: <integer>
86 # px_svr_timeout: <integer>
87 # conn_refresh_interval: <integer>
88 # cloud_orchest_refresh_interval: <integer>
89 # faznotify_msg_queue_max: <integer>
90 # faznotify_msg_timeout: <integer>
91 # conn_ssl_protocol: <value in [follow-global-ssl-protocol, sslv3, tlsv1.0, ...]>
92 '''
93
94 RETURN = '''
95 meta:
96 description: The result of the request.
97 type: dict
98 returned: always
99 contains:
100 request_url:
101 description: The full url requested.
102 returned: always
103 type: str
104 sample: /sys/login/user
105 response_code:
106 description: The status of api request.
107 returned: always
108 type: int
109 sample: 0
110 response_data:
111 description: The api response.
112 type: list
113 returned: always
114 response_message:
115 description: The descriptive message of the api response.
116 type: str
117 returned: always
118 sample: OK.
119 system_information:
120 description: The information of the target system.
121 type: dict
122 returned: always
123 rc:
124 description: The status the request.
125 type: int
126 returned: always
127 sample: 0
128 version_check_warning:
129 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
130 type: list
131 returned: complex
132 '''
133 from ansible.module_utils.basic import AnsibleModule
134 from ansible.module_utils.connection import Connection
135 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
136 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
137
138
139 def main():
140 urls_list = [
141 '/cli/global/system/connector'
142 ]
143 module_arg_spec = {
144 'system_connector': {
145 'type': 'dict', 'v_range': [['6.0.0', '']],
146 'options': {
147 'fsso-refresh-interval': {'type': 'int'},
148 'fsso-sess-timeout': {'type': 'int'},
149 'px-refresh-interval': {'v_range': [['6.0.0', '7.0.1']], 'type': 'int'},
150 'px-svr-timeout': {'type': 'int'},
151 'conn-refresh-interval': {'v_range': [['7.0.2', '']], 'type': 'int'},
152 'cloud-orchest-refresh-interval': {'v_range': [['7.4.0', '']], 'type': 'int'},
153 'faznotify-msg-queue-max': {'v_range': [['7.4.2', '']], 'type': 'int'},
154 'faznotify-msg-timeout': {'v_range': [['7.4.2', '']], 'type': 'int'},
155 'conn-ssl-protocol': {
156 'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']],
157 'choices': ['follow-global-ssl-protocol', 'sslv3', 'tlsv1.0', 'tlsv1.1', 'tlsv1.2', 'tlsv1.3'],
158 'type': 'str'
159 }
160 }
161 }
162 }
163
164 module_option_spec = get_module_arg_spec('partial crud')
165 module_arg_spec.update(module_option_spec)
166 check_galaxy_version(module_arg_spec)
167 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'system_connector'),
168 supports_check_mode=True)
169 if not module._socket_path:
170 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
171 connection = Connection(module._socket_path)
172 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
173 None, 'data', module, connection)
174 fmgr.process_partial_crud()
175 module.exit_json(meta=module.params)
176
177
178 if __name__ == '__main__':
179 main()