Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_firewall_accessproxy_serverpubkeyauthsettings.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_firewall_accessproxy_serverpubkeyauthsettings
15 short_description: Server SSH public key authentication settings.
16 version_added: "2.1.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.partial_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 access-proxy:
29 description: Deprecated, please use "access_proxy"
30 type: str
31 access_proxy:
32 description: The parameter (access-proxy) in requested url.
33 type: str
34 firewall_accessproxy_serverpubkeyauthsettings:
35 description: The top level parameters set.
36 required: false
37 type: dict
38 suboptions:
39 auth_ca:
40 aliases: ['auth-ca']
41 type: str
42 description: Name of the SSH server public key authentication CA.
43 cert_extension:
44 aliases: ['cert-extension']
45 type: list
46 elements: dict
47 description: Cert extension.
48 suboptions:
49 critical:
50 type: str
51 description: Critical option.
52 choices: ['no', 'yes']
53 data:
54 type: str
55 description: Name of certificate extension.
56 name:
57 type: str
58 description: Name of certificate extension.
59 type:
60 type: str
61 description: Type of certificate extension.
62 choices: ['fixed', 'user']
63 permit_agent_forwarding:
64 aliases: ['permit-agent-forwarding']
65 type: str
66 description: Enable/disable appending permit-agent-forwarding certificate extension.
67 choices: ['disable', 'enable']
68 permit_port_forwarding:
69 aliases: ['permit-port-forwarding']
70 type: str
71 description: Enable/disable appending permit-port-forwarding certificate extension.
72 choices: ['disable', 'enable']
73 permit_pty:
74 aliases: ['permit-pty']
75 type: str
76 description: Enable/disable appending permit-pty certificate extension.
77 choices: ['disable', 'enable']
78 permit_user_rc:
79 aliases: ['permit-user-rc']
80 type: str
81 description: Enable/disable appending permit-user-rc certificate extension.
82 choices: ['disable', 'enable']
83 permit_x11_forwarding:
84 aliases: ['permit-x11-forwarding']
85 type: str
86 description: Enable/disable appending permit-x11-forwarding certificate extension.
87 choices: ['disable', 'enable']
88 source_address:
89 aliases: ['source-address']
90 type: str
91 description: Enable/disable appending source-address certificate critical option.
92 choices: ['disable', 'enable']
93 '''
94
95 EXAMPLES = '''
96 - name: Example playbook (generated based on argument schema)
97 hosts: fortimanagers
98 connection: httpapi
99 gather_facts: false
100 tasks:
101 - name: Server SSH public key authentication settings.
102 fortinet.fortimanager.fmgr_firewall_accessproxy_serverpubkeyauthsettings:
103 # workspace_locking_adom: <global or your adom name>
104 adom: <your own value>
105 access_proxy: <your own value>
106 firewall_accessproxy_serverpubkeyauthsettings:
107 # auth_ca: <string>
108 # cert_extension:
109 # - critical: <value in [no, yes]>
110 # data: <string>
111 # name: <string>
112 # type: <value in [fixed, user]>
113 # permit_agent_forwarding: <value in [disable, enable]>
114 # permit_port_forwarding: <value in [disable, enable]>
115 # permit_pty: <value in [disable, enable]>
116 # permit_user_rc: <value in [disable, enable]>
117 # permit_x11_forwarding: <value in [disable, enable]>
118 # source_address: <value in [disable, enable]>
119 '''
120
121 RETURN = '''
122 meta:
123 description: The result of the request.
124 type: dict
125 returned: always
126 contains:
127 request_url:
128 description: The full url requested.
129 returned: always
130 type: str
131 sample: /sys/login/user
132 response_code:
133 description: The status of api request.
134 returned: always
135 type: int
136 sample: 0
137 response_data:
138 description: The api response.
139 type: list
140 returned: always
141 response_message:
142 description: The descriptive message of the api response.
143 type: str
144 returned: always
145 sample: OK.
146 system_information:
147 description: The information of the target system.
148 type: dict
149 returned: always
150 rc:
151 description: The status the request.
152 type: int
153 returned: always
154 sample: 0
155 version_check_warning:
156 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
157 type: list
158 returned: complex
159 '''
160 from ansible.module_utils.basic import AnsibleModule
161 from ansible.module_utils.connection import Connection
162 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
163 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
164
165
166 def main():
167 urls_list = [
168 '/pm/config/adom/{adom}/obj/firewall/access-proxy/{access-proxy}/server-pubkey-auth-settings',
169 '/pm/config/global/obj/firewall/access-proxy/{access-proxy}/server-pubkey-auth-settings'
170 ]
171 module_arg_spec = {
172 'adom': {'required': True, 'type': 'str'},
173 'access-proxy': {'type': 'str', 'api_name': 'access_proxy'},
174 'access_proxy': {'type': 'str'},
175 'revision_note': {'type': 'str'},
176 'firewall_accessproxy_serverpubkeyauthsettings': {
177 'type': 'dict', 'v_range': [['7.0.0', '']],
178 'options': {
179 'auth-ca': {'v_range': [['7.0.0', '']], 'type': 'str'},
180 'cert-extension': {
181 'v_range': [['7.0.0', '']],
182 'type': 'list',
183 'options': {
184 'critical': {'v_range': [['7.0.0', '']], 'choices': ['no', 'yes'], 'type': 'str'},
185 'data': {'v_range': [['7.0.0', '']], 'type': 'str'},
186 'name': {'v_range': [['7.0.0', '']], 'type': 'str'},
187 'type': {'v_range': [['7.0.0', '']], 'choices': ['fixed', 'user'], 'type': 'str'}
188 },
189 'elements': 'dict'
190 },
191 'permit-agent-forwarding': {'v_range': [['7.0.0', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
192 'permit-port-forwarding': {'v_range': [['7.0.0', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
193 'permit-pty': {'v_range': [['7.0.0', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
194 'permit-user-rc': {'v_range': [['7.0.0', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
195 'permit-x11-forwarding': {'v_range': [['7.0.0', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
196 'source-address': {'v_range': [['7.0.0', '']], 'choices': ['disable', 'enable'], 'type': 'str'}
197 }
198 }
199 }
200
201 module_option_spec = get_module_arg_spec('partial crud')
202 module_arg_spec.update(module_option_spec)
203 check_galaxy_version(module_arg_spec)
204 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'firewall_accessproxy_serverpubkeyauthsettings'),
205 supports_check_mode=True)
206 if not module._socket_path:
207 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
208 connection = Connection(module._socket_path)
209 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
210 None, 'data', module, connection)
211 fmgr.process_partial_crud()
212 module.exit_json(meta=module.params)
213
214
215 if __name__ == '__main__':
216 main()