Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_saml_fabricidp.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_saml_fabricidp
15 short_description: Authorized identity providers.
16 version_added: "2.1.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.full_crud
20 options:
21 system_saml_fabricidp:
22 description: The top level parameters set.
23 required: false
24 type: dict
25 suboptions:
26 dev_id:
27 aliases: ['dev-id']
28 type: str
29 description: IDP Device ID.
30 idp_cert:
31 aliases: ['idp-cert']
32 type: str
33 description: IDP Certificate name.
34 idp_entity_id:
35 aliases: ['idp-entity-id']
36 type: str
37 description: IDP entity ID.
38 idp_single_logout_url:
39 aliases: ['idp-single-logout-url']
40 type: str
41 description: IDP single logout url.
42 idp_single_sign_on_url:
43 aliases: ['idp-single-sign-on-url']
44 type: str
45 description: IDP single sign-on URL.
46 idp_status:
47 aliases: ['idp-status']
48 type: str
49 description:
50 - Enable/disable SAML authentication
51 - disable - Disable SAML authentication.
52 - enable - Enabld SAML authentication.
53 choices: ['disable', 'enable']
54 '''
55
56 EXAMPLES = '''
57 - name: Example playbook (generated based on argument schema)
58 hosts: fortimanagers
59 connection: httpapi
60 gather_facts: false
61 tasks:
62 - name: Authorized identity providers.
63 fortinet.fortimanager.fmgr_system_saml_fabricidp:
64 # workspace_locking_adom: <global or your adom name>
65 state: present # <value in [present, absent]>
66 system_saml_fabricidp:
67 # dev_id: <string>
68 # idp_cert: <string>
69 # idp_entity_id: <string>
70 # idp_single_logout_url: <string>
71 # idp_single_sign_on_url: <string>
72 # idp_status: <value in [disable, enable]>
73 '''
74
75 RETURN = '''
76 meta:
77 description: The result of the request.
78 type: dict
79 returned: always
80 contains:
81 request_url:
82 description: The full url requested.
83 returned: always
84 type: str
85 sample: /sys/login/user
86 response_code:
87 description: The status of api request.
88 returned: always
89 type: int
90 sample: 0
91 response_data:
92 description: The api response.
93 type: list
94 returned: always
95 response_message:
96 description: The descriptive message of the api response.
97 type: str
98 returned: always
99 sample: OK.
100 system_information:
101 description: The information of the target system.
102 type: dict
103 returned: always
104 rc:
105 description: The status the request.
106 type: int
107 returned: always
108 sample: 0
109 version_check_warning:
110 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
111 type: list
112 returned: complex
113 '''
114 from ansible.module_utils.basic import AnsibleModule
115 from ansible.module_utils.connection import Connection
116 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
117 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
118
119
120 def main():
121 urls_list = [
122 '/cli/global/system/saml/fabric-idp'
123 ]
124 module_arg_spec = {
125 'system_saml_fabricidp': {
126 'type': 'dict', 'v_range': [['6.4.0', '']],
127 'options': {
128 'dev-id': {'v_range': [['6.4.0', '']], 'type': 'str'},
129 'idp-cert': {'v_range': [['6.4.0', '']], 'type': 'str'},
130 'idp-entity-id': {'v_range': [['6.4.0', '']], 'type': 'str'},
131 'idp-single-logout-url': {'v_range': [['6.4.0', '']], 'type': 'str'},
132 'idp-single-sign-on-url': {'v_range': [['6.4.0', '']], 'type': 'str'},
133 'idp-status': {'v_range': [['6.4.0', '']], 'choices': ['disable', 'enable'], 'type': 'str'}
134 }
135 }
136 }
137
138 module_option_spec = get_module_arg_spec('full crud')
139 module_arg_spec.update(module_option_spec)
140 check_galaxy_version(module_arg_spec)
141 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'system_saml_fabricidp'),
142 supports_check_mode=True)
143 if not module._socket_path:
144 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
145 connection = Connection(module._socket_path)
146 fmgr = NAPIManager('full crud', module_arg_spec, urls_list,
147 None, 'data', module, connection)
148 fmgr.process_crud()
149 module.exit_json(meta=module.params)
150
151
152 if __name__ == '__main__':
153 main()