Skip to content

Commit 9cfe3b0

Browse files
authored
new R81.20 JHF modules (#117)
* v5.1.3 * new R81.20 JHF modules
1 parent e0e9a6e commit 9cfe3b0

10 files changed

+522
-4
lines changed

CHANGELOG.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@ Check_Point.Mgmt Release Notes
44

55
.. contents:: Topics
66

7+
8+
v5.2.0
9+
======
10+
11+
Release Summary
12+
---------------
13+
14+
This is release 5.2.0 of ``check_point.mgmt``, released on 2024-01-10.
15+
16+
Minor Changes
17+
-------------
18+
19+
- New resource modules for R81.20 JHF Take 43
20+
21+
New Modules
22+
-----------
23+
24+
- check_point.mgmt.cp_mgmt_add_central_license - Add central license.
25+
- check_point.mgmt.cp_mgmt_delete_central_license - Delete central license.
26+
- check_point.mgmt.cp_mgmt_central_license_facts - Get central-license objects facts on Checkpoint over Web Services API.
27+
- check_point.mgmt.cp_mgmt_distribute_cloud_licenses - Distribute licenses to target CloudGuard gateways.
28+
- check_point.mgmt.cp_mgmt_show_cloud_licenses_usage - Show attached licenses usage.
29+
- check_point.mgmt.cp_mgmt_show_ha_status - Retrieve domain high availability status.
30+
731
v5.1.3
832
======
933

changelogs/changelog.yaml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,5 +1051,33 @@ releases:
10511051
release_summary: This is release 5.1.3 of ``check_point.mgmt``, released on
10521052
2023-12-13.
10531053
fragments:
1054-
- 5.1.2.yml
1055-
release_date: '2022-12-13'
1054+
- 5.1.3.yml
1055+
release_date: '2022-12-13'
1056+
5.2.0:
1057+
changes:
1058+
minor_changes:
1059+
- New resource modules for R81.20 JHF Take 43
1060+
release_summary: This is release 5.2.0 of ``check_point.mgmt``, released on
1061+
2024-01-10.
1062+
fragments:
1063+
- 5.2.0.yml
1064+
modules:
1065+
- description: Add central license.
1066+
name: cp_mgmt_add_central_license
1067+
namespace: ''
1068+
- description: Delete central license.
1069+
name: cp_mgmt_delete_central_license
1070+
namespace: ''
1071+
- description: Get central-license objects facts on Checkpoint over Web Services API
1072+
name: cp_mgmt_central_license_facts
1073+
namespace: ''
1074+
- description: Distribute licenses to target CloudGuard gateways.
1075+
name: cp_mgmt_distribute_cloud_licenses
1076+
namespace: ''
1077+
- description: Show attached licenses usage.
1078+
name: cp_mgmt_show_cloud_licenses_usage
1079+
namespace: ''
1080+
- description: Retrieve domain high availability status.
1081+
name: cp_mgmt_show_ha_status
1082+
namespace: ''
1083+
release_date: '2024-01-10'

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace: check_point
99
name: mgmt
1010

1111
# The version of the collection. Must be compatible with semantic versioning
12-
version: 5.1.3
12+
version: 5.2.0
1313

1414
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
1515
readme: README.md

plugins/module_utils/checkpoint.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def is_checkpoint_param(parameter):
264264

265265

266266
def contains_show_identifier_param(payload):
267-
identifier_params = ["name", "uid", "assigned-domain", "task-id"]
267+
identifier_params = ["name", "uid", "assigned-domain", "task-id", "signature"]
268268
for param in identifier_params:
269269
if payload.get(param) is not None:
270270
return True
@@ -300,6 +300,7 @@ def get_payload_from_parameters(params):
300300
or parameter == "server_version"
301301
or parameter == "check_point_host_version"
302302
or parameter == "target_version"
303+
or parameter == "vsx_version"
303304
):
304305
parameter = "version"
305306

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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_add_central_license
31+
short_description: Add central license.
32+
description:
33+
- Add central license.
34+
- All operations are performed over Web Services API.
35+
version_added: "5.2.0"
36+
author: "Eden Brillant (@chkp-edenbr)"
37+
options:
38+
license:
39+
description:
40+
- The license string received from the User Center - without 'cplic put'.
41+
type: str
42+
extends_documentation_fragment: check_point.mgmt.checkpoint_commands
43+
"""
44+
45+
EXAMPLES = """
46+
- name: add-central-license
47+
cp_mgmt_add_central_license:
48+
license: 192.168.1.2 never dTTTTTT-WWWWWW-SSSSSSS-QQQQQQ CPSG-VE+3 CPBS-BECE CPSB-DFW CPSM-C-2 CPSB-VPN CPSB-NPM CPSB-LOGS CPSB-IA
49+
CPSB-ADNC CPSB-SSLVWPN-5 CK-66666666
50+
"""
51+
52+
RETURN = """
53+
cp_mgmt_add_central_license:
54+
description: The checkpoint add-central-license output.
55+
returned: always.
56+
type: dict
57+
"""
58+
59+
from ansible.module_utils.basic import AnsibleModule
60+
from ansible_collections.check_point.mgmt.plugins.module_utils.checkpoint import checkpoint_argument_spec_for_commands, api_command
61+
62+
63+
def main():
64+
argument_spec = dict(
65+
license=dict(type='str')
66+
)
67+
argument_spec.update(checkpoint_argument_spec_for_commands)
68+
69+
module = AnsibleModule(argument_spec=argument_spec)
70+
71+
command = "add-central-license"
72+
73+
result = api_command(module, command)
74+
module.exit_json(**result)
75+
76+
77+
if __name__ == '__main__':
78+
main()
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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_central_license_facts
31+
short_description: Get central-license objects facts on Checkpoint over Web Services API
32+
description:
33+
- Get central-license objects facts on Checkpoint devices.
34+
- All operations are performed over Web Services API.
35+
- This module handles both operations, get a specific object and get several objects,
36+
For getting a specific object use the parameter 'signature'.
37+
version_added: "5.2.0"
38+
author: "Eden Brillant (@chkp-edenbr)"
39+
options:
40+
signature:
41+
description:
42+
- The license's signature. This parameter is relevant only for getting a specific object.
43+
type: str
44+
extends_documentation_fragment: checkpoint_facts
45+
"""
46+
47+
EXAMPLES = """
48+
- name: show-central-license
49+
cp_mgmt_central_license_facts:
50+
signature: dLLLLL-WWWWWW-ZZZZZZ-QQQQQQ
51+
52+
- name: show-central-licenses
53+
cp_mgmt_show_central_licenses:
54+
"""
55+
56+
RETURN = """
57+
ansible_facts:
58+
description: The checkpoint object facts.
59+
returned: always.
60+
type: dict
61+
"""
62+
63+
from ansible.module_utils.basic import AnsibleModule
64+
from ansible_collections.check_point.mgmt.plugins.module_utils.checkpoint import (
65+
checkpoint_argument_spec_for_facts,
66+
api_call_facts,
67+
)
68+
69+
70+
def main():
71+
argument_spec = dict(
72+
signature=dict(type='str')
73+
)
74+
argument_spec.update(checkpoint_argument_spec_for_facts)
75+
76+
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
77+
78+
api_call_object = "central-license"
79+
api_call_object_plural_version = "central-licenses"
80+
81+
result = api_call_facts(module, api_call_object, api_call_object_plural_version)
82+
module.exit_json(ansible_facts=result)
83+
84+
85+
if __name__ == '__main__':
86+
main()
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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_delete_central_license
31+
short_description: Delete central license.
32+
description:
33+
- Delete central license.
34+
- All operations are performed over Web Services API.
35+
version_added: "5.2.0"
36+
author: "Eden Brillant (@chkp-edenbr)"
37+
options:
38+
signature:
39+
description:
40+
- The license's signature to be deleted.
41+
type: str
42+
extends_documentation_fragment: check_point.mgmt.checkpoint_commands
43+
"""
44+
45+
EXAMPLES = """
46+
- name: delete-central-license
47+
cp_mgmt_delete_central_license:
48+
signature: dTTTTTT-WWWWWW-SSSSSSS-QQQQQQ
49+
"""
50+
51+
RETURN = """
52+
cp_mgmt_delete_central_license:
53+
description: The checkpoint delete-central-license output.
54+
returned: always.
55+
type: dict
56+
"""
57+
58+
from ansible.module_utils.basic import AnsibleModule
59+
from ansible_collections.check_point.mgmt.plugins.module_utils.checkpoint import checkpoint_argument_spec_for_commands, api_command
60+
61+
62+
def main():
63+
argument_spec = dict(
64+
signature=dict(type='str')
65+
)
66+
argument_spec.update(checkpoint_argument_spec_for_commands)
67+
68+
module = AnsibleModule(argument_spec=argument_spec)
69+
70+
command = "delete-central-license"
71+
72+
result = api_command(module, command)
73+
module.exit_json(**result)
74+
75+
76+
if __name__ == '__main__':
77+
main()

0 commit comments

Comments
 (0)