Debian Codegraph @

ansible_collections/check_point/mgmt/plugins/modules/cp_mgmt_test_trust.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_test_trust
31 short_description: Test an existing Trusted communication between the Management Server and the managed Security Gateway.
32 description:
33 - Test an existing Trusted communication between the Management Server and the managed Security Gateway.
34 - All operations are performed over Web Services API.
35 - Available from R82.10 management version.
36 version_added: "6.7.0"
37 author: "Eden Brillant (@chkp-edenbr)"
38 options:
39 name:
40 description:
41 - Object name.
42 type: str
43 trust_method:
44 description:
45 - Establish the trust communication method.
46 type: str
47 choices: ['one_time_password', 'without_password_not_secure', 'cloud_token']
48 domains_to_process:
49 description:
50 - Indicates which domains to process the commands on. It cannot be used with the details-level full, must be run from the System Domain only and
51 with ignore-warnings true. Valid values are, CURRENT_DOMAIN, ALL_DOMAINS_ON_THIS_SERVER.
52 type: list
53 elements: str
54 extends_documentation_fragment: check_point.mgmt.checkpoint_commands
55 """
56
57 EXAMPLES = """
58 - name: test-trust
59 cp_mgmt_test_trust:
60 name: gw1
61 """
62
63 RETURN = """
64 cp_mgmt_test_trust:
65 description: The checkpoint set-trust output.
66 returned: always.
67 type: dict
68 """
69
70 from ansible.module_utils.basic import AnsibleModule
71 from ansible_collections.check_point.mgmt.plugins.module_utils.checkpoint import checkpoint_argument_spec_for_commands, api_command
72
73
74 def main():
75 argument_spec = dict(
76 name=dict(type='str'),
77 trust_method=dict(type='str', choices=['one_time_password', 'without_password_not_secure', 'cloud_token']),
78 domains_to_process=dict(type='list', elements='str')
79 )
80 argument_spec.update(checkpoint_argument_spec_for_commands)
81
82 module = AnsibleModule(argument_spec=argument_spec)
83
84 command = "test-trust"
85
86 result = api_command(module, command)
87 module.exit_json(**result)
88
89
90 if __name__ == '__main__':
91 main()