Debian Codegraph @

ansible_collections/check_point/mgmt/plugins/modules/cp_mgmt_set_login_message.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 #
4 # Ansible module to manage CheckPoint Firewall (c) 2019
5 #
6 # Ansible is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # Ansible is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 from __future__ import (absolute_import, division, print_function)
21
22 __metaclass__ = type
23
24 ANSIBLE_METADATA = {'metadata_version': '1.1',
25 'status': ['preview'],
26 'supported_by': 'community'}
27
28 DOCUMENTATION = """
29 ---
30 module: cp_mgmt_set_login_message
31 short_description: Edit Login message.
32 description:
33 - Edit Login message.
34 - All operations are performed over Web Services API.
35 - Available from R80 management version.
36 version_added: "5.0.0"
37 author: "Eden Brillant (@chkp-edenbr)"
38 options:
39 header:
40 description:
41 - Login message header.
42 type: str
43 login_message:
44 description:
45 - Login message body.
46 type: str
47 show_message:
48 description:
49 - Whether to show login message.
50 type: bool
51 warning:
52 description:
53 - Add warning sign.
54 type: bool
55 details_level:
56 description:
57 - The level of detail for some of the fields in the response can vary from showing only the UID value of the object to a fully detailed
58 representation of the object.
59 type: str
60 choices: ['uid', 'standard', 'full']
61 extends_documentation_fragment: check_point.mgmt.checkpoint_commands
62 """
63
64 EXAMPLES = """
65 - name: set-login-message
66 cp_mgmt_set_login_message:
67 header: Warning
68 login_message: Unauthorized access of this server is prohibited and punished by law
69 show_message: 'true'
70 warning: 'true'
71 """
72
73 RETURN = """
74 cp_mgmt_set_login_message:
75 description: The checkpoint set-login-message output.
76 returned: always.
77 type: dict
78 """
79
80 from ansible.module_utils.basic import AnsibleModule
81 from ansible_collections.check_point.mgmt.plugins.module_utils.checkpoint import checkpoint_argument_spec_for_commands, api_command
82
83
84 def main():
85 argument_spec = dict(
86 header=dict(type='str'),
87 login_message=dict(type='str'),
88 show_message=dict(type='bool'),
89 warning=dict(type='bool'),
90 details_level=dict(type='str', choices=['uid', 'standard', 'full'])
91 )
92 argument_spec.update(checkpoint_argument_spec_for_commands)
93
94 module = AnsibleModule(argument_spec=argument_spec)
95
96 command = "set-login-message"
97
98 result = api_command(module, command)
99 module.exit_json(**result)
100
101
102 if __name__ == '__main__':
103 main()