Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_firewall_profileprotocoloptions_mailsignature.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_profileprotocoloptions_mailsignature
15 short_description: Configure Mail signature.
16 version_added: "2.0.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 profile-protocol-options:
29 description: Deprecated, please use "profile_protocol_options"
30 type: str
31 profile_protocol_options:
32 description: The parameter (profile-protocol-options) in requested url.
33 type: str
34 firewall_profileprotocoloptions_mailsignature:
35 description: The top level parameters set.
36 required: false
37 type: dict
38 suboptions:
39 signature:
40 type: str
41 description: Email signature to be added to outgoing email
42 status:
43 type: str
44 description: Enable/disable adding an email signature to SMTP email messages as they pass through the FortiGate.
45 choices: ['disable', 'enable']
46 '''
47
48 EXAMPLES = '''
49 - name: Example playbook (generated based on argument schema)
50 hosts: fortimanagers
51 connection: httpapi
52 gather_facts: false
53 tasks:
54 - name: Configure Mail signature.
55 fortinet.fortimanager.fmgr_firewall_profileprotocoloptions_mailsignature:
56 # workspace_locking_adom: <global or your adom name>
57 adom: <your own value>
58 profile_protocol_options: <your own value>
59 firewall_profileprotocoloptions_mailsignature:
60 # signature: <string>
61 # status: <value in [disable, enable]>
62 '''
63
64 RETURN = '''
65 meta:
66 description: The result of the request.
67 type: dict
68 returned: always
69 contains:
70 request_url:
71 description: The full url requested.
72 returned: always
73 type: str
74 sample: /sys/login/user
75 response_code:
76 description: The status of api request.
77 returned: always
78 type: int
79 sample: 0
80 response_data:
81 description: The api response.
82 type: list
83 returned: always
84 response_message:
85 description: The descriptive message of the api response.
86 type: str
87 returned: always
88 sample: OK.
89 system_information:
90 description: The information of the target system.
91 type: dict
92 returned: always
93 rc:
94 description: The status the request.
95 type: int
96 returned: always
97 sample: 0
98 version_check_warning:
99 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
100 type: list
101 returned: complex
102 '''
103 from ansible.module_utils.basic import AnsibleModule
104 from ansible.module_utils.connection import Connection
105 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
106 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
107
108
109 def main():
110 urls_list = [
111 '/pm/config/adom/{adom}/obj/firewall/profile-protocol-options/{profile-protocol-options}/mail-signature',
112 '/pm/config/global/obj/firewall/profile-protocol-options/{profile-protocol-options}/mail-signature'
113 ]
114 module_arg_spec = {
115 'adom': {'required': True, 'type': 'str'},
116 'profile-protocol-options': {'type': 'str', 'api_name': 'profile_protocol_options'},
117 'profile_protocol_options': {'type': 'str'},
118 'revision_note': {'type': 'str'},
119 'firewall_profileprotocoloptions_mailsignature': {
120 'type': 'dict', 'v_range': [['6.0.0', '']],
121 'options': {'signature': {'type': 'str'}, 'status': {'choices': ['disable', 'enable'], 'type': 'str'}}
122 }
123 }
124
125 module_option_spec = get_module_arg_spec('partial crud')
126 module_arg_spec.update(module_option_spec)
127 check_galaxy_version(module_arg_spec)
128 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'firewall_profileprotocoloptions_mailsignature'),
129 supports_check_mode=True)
130 if not module._socket_path:
131 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
132 connection = Connection(module._socket_path)
133 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
134 None, 'data', module, connection)
135 fmgr.process_partial_crud()
136 module.exit_json(meta=module.params)
137
138
139 if __name__ == '__main__':
140 main()