Skip to content

Commit af769b8

Browse files
authored
ansible tests bug fixes (#122)
* v5.1.3 * ansible-lint bug fixes * ansible-lint bug fixes * ansible-lint bug fixes * ansible test bug-fixes
1 parent 906df6f commit af769b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+144
-69
lines changed

CHANGELOG.rst

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

55
.. contents:: Topics
66

7+
v5.2.2
8+
======
9+
10+
Release Summary
11+
---------------
12+
13+
This is release 5.2.2 of ``check_point.mgmt``, released on 2024-01-28.
14+
715
v5.2.1
816
======
917

changelogs/changelog.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,3 +956,10 @@ releases:
956956
fragments:
957957
- 5.2.1.yml
958958
release_date: "2024-01-16"
959+
5.2.2:
960+
changes:
961+
release_summary: This is release 5.2.2 of ``check_point.mgmt``, released on
962+
2024-01-28.
963+
fragments:
964+
- 5.2.2.yml
965+
release_date: '2024-01-28'

galaxy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ namespace: check_point
99
name: mgmt
1010

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

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

1717
# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
1818
# @nicks:irc/im.site#channel'
1919
authors:
20-
- Or Soffer <orso@checkpoint.com>
21-
- Shiran Golzar <shirango@checkpoint.com>
22-
- Eden Brillant <edenbr@checkpoint.com>
20+
- Or Soffer <orso@checkpoint.com>
21+
- Shiran Golzar <shirango@checkpoint.com>
22+
- Eden Brillant <edenbr@checkpoint.com>
2323

2424

2525
### OPTIONAL but strongly recommended
@@ -30,7 +30,7 @@ description: Check Point collection for the Management Server
3030
# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
3131
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
3232
license:
33-
- GPL-2.0-or-later
33+
- GPL-2.0-or-later
3434

3535
# The path to the license file for the collection. This path is relative to the root of the collection. This key is
3636
# mutually exclusive with 'license'

meta/runtime.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,52 @@
11
---
22
requires_ansible: ">=2.14.0"
3+
plugin_routing:
4+
modules:
5+
cp_mgmt_add_nat_rule:
6+
deprecation:
7+
removal_date: "2024-11-01"
8+
warning_text: >
9+
cp_mgmt_add_nat_rule will be removed in a future release of this collection.
10+
Use newer and updated module cp_mgmt_nat_rule with more functionality instead.
11+
cp_mgmt_set_nat_rule:
12+
deprecation:
13+
removal_date: "2024-11-01"
14+
warning_text: >
15+
cp_mgmt_set_nat_rule will be removed in a future release of this collection.
16+
Use newer and updated module cp_mgmt_nat_rule with more functionality instead.
17+
cp_mgmt_delete_nat_rule:
18+
deprecation:
19+
removal_date: "2024-11-01"
20+
warning_text: >
21+
cp_mgmt_delete_nat_rule will be removed in a future release of this collection.
22+
Use newer and updated module cp_mgmt_nat_rule with more functionality instead.
23+
cp_mgmt_access_layer:
24+
deprecation:
25+
removal_date: "2024-11-01"
26+
warning_text: >
27+
cp_mgmt_access_layer will be removed in a future release of this collection.
28+
Use newer and updated module cp_mgmt_access_layers with more functionality instead.
29+
cp_mgmt_show_task:
30+
deprecation:
31+
removal_date: "2024-11-01"
32+
warning_text: >
33+
cp_mgmt_show_task will be removed in a future release of this collection.
34+
Use newer and updated module cp_mgmt_task_facts instead.
35+
cp_mgmt_show_tasks:
36+
deprecation:
37+
removal_date: "2024-11-01"
38+
warning_text: >
39+
cp_mgmt_show_tasks will be removed in a future release of this collection.
40+
Use newer and updated module cp_mgmt_task_facts instead.
41+
cp_mgmt_host:
42+
deprecation:
43+
removal_date: "2024-11-01"
44+
warning_text: >
45+
cp_mgmt_host will be removed in a future release of this collection.
46+
Use newer and updated module cp_mgmt_hosts with more functionality instead.
47+
cp_mgmt_threat_layer:
48+
deprecation:
49+
removal_date: "2024-11-01"
50+
warning_text: >
51+
cp_mgmt_threat_layer will be removed in a future release of this collection.
52+
Use newer and updated module cp_mgmt_threat_layers with more functionality instead.

plugins/doc_fragments/checkpoint_commands.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@ class ModuleDocFragment(object):
2727
description:
2828
- Version of checkpoint. If not given one, the latest version taken.
2929
type: str
30+
auto_publish_session:
31+
description:
32+
- Publish the current session if changes have been performed after task completes.
33+
type: bool
34+
default: False
3035
"""

plugins/doc_fragments/checkpoint_objects.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@ class ModuleDocFragment(object):
1515
options:
1616
state:
1717
description:
18-
- State of the access rule (present or absent). Defaults to present.
18+
- State of the access rule (present or absent).
1919
type: str
2020
default: present
21-
choices:
22-
- 'present'
23-
- 'absent'
21+
choices: ['present', 'absent']
2422
auto_publish_session:
2523
description:
26-
- Publish the current session if changes have been performed
27-
after task completes.
24+
- Publish the current session if changes have been performed after task completes.
2825
type: bool
26+
default: False
2927
wait_for_task:
3028
description:
3129
- Wait for the task to end. Such as publish task.

plugins/doc_fragments/checkpoint_objects_action_module.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class ModuleDocFragment(object):
1818
- Publish the current session if changes have been performed
1919
after task completes.
2020
type: bool
21+
default: False
2122
wait_for_task_timeout:
2223
description:
2324
- How many minutes to wait until throwing a timeout error.

plugins/module_utils/checkpoint.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@
4646
}
4747

4848
checkpoint_argument_spec_for_action_module = dict(
49-
auto_publish_session=dict(type="bool"),
49+
auto_publish_session=dict(type="bool", default=False),
5050
wait_for_task_timeout=dict(type="int", default=30),
5151
version=dict(type="str"),
5252
)
5353

5454
checkpoint_argument_spec_for_objects = dict(
55-
auto_publish_session=dict(type="bool"),
55+
auto_publish_session=dict(type="bool", default=False),
5656
wait_for_task=dict(type="bool", default=True),
5757
wait_for_task_timeout=dict(type="int", default=30),
5858
state=dict(type="str", choices=["present", "absent"], default="present"),
@@ -65,7 +65,7 @@
6565
wait_for_task=dict(type="bool", default=True),
6666
wait_for_task_timeout=dict(type="int", default=30),
6767
version=dict(type="str"),
68-
auto_publish_session=dict(type="bool"),
68+
auto_publish_session=dict(type="bool", default=False),
6969
)
7070

7171
delete_params = [
@@ -76,7 +76,8 @@
7676
"rule-name",
7777
"package",
7878
"ignore-errors",
79-
"ignore-warnings"
79+
"ignore-warnings",
80+
"gateway-uid"
8081
]
8182

8283
remove_from_set_payload = {
@@ -304,6 +305,10 @@ def get_payload_from_parameters(params):
304305
):
305306
parameter = "version"
306307

308+
# message & syslog_facility are internally used by Ansible, so need to avoid param duplicity
309+
elif parameter == "login_message":
310+
parameter = "message"
311+
307312
payload[parameter.replace("_", "-")] = parameter_value
308313

309314
return payload
@@ -579,7 +584,7 @@ def api_call_facts(module, api_call_object, api_call_object_plural_version):
579584
False,
580585
False,
581586
)
582-
result = {api_call_object: response}
587+
result = {api_call_object.replace("-", "_"): response}
583588
return result
584589

585590

@@ -1431,12 +1436,12 @@ def api_call_facts_for_rule(
14311436

14321437

14331438
# The code from here till EOF will be deprecated when Rikis' modules will be deprecated
1434-
checkpoint_argument_spec = dict(
1435-
auto_publish_session=dict(type="bool", default=True),
1436-
policy_package=dict(type="str", default="standard"),
1437-
auto_install_policy=dict(type="bool", default=True),
1438-
targets=dict(type="list"),
1439-
)
1439+
# checkpoint_argument_spec = dict(
1440+
# auto_publish_session=dict(type="bool", default=True),
1441+
# policy_package=dict(type="str", default="standard"),
1442+
# auto_install_policy=dict(type="bool", default=True),
1443+
# targets=dict(type="list"),
1444+
# )
14401445

14411446

14421447
def publish(connection, uid=None):

plugins/modules/cp_mgmt_access_layer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
ANSIBLE_METADATA = {
2525
"metadata_version": "1.1",
26-
"status": ["preview"],
26+
"status": ["deprecated"],
2727
"supported_by": "community",
2828
}
2929

plugins/modules/cp_mgmt_access_point_name_facts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def main():
131131
)
132132
argument_spec.update(checkpoint_argument_spec_for_facts)
133133

134-
module = AnsibleModule(argument_spec=argument_spec)
134+
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
135135

136136
api_call_object = "access-point-name"
137137
api_call_object_plural_version = "access-point-names"

0 commit comments

Comments
 (0)