Skip to content

Commit 5aaa841

Browse files
authored
Merge pull request #28 from chkp-ameera/master
add new modules and update version to 5.0.0
2 parents cc9da19 + 7e1c3a6 commit 5aaa841

File tree

7 files changed

+390
-2
lines changed

7 files changed

+390
-2
lines changed

CHANGELOG.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ Check_Point.gaia Release Notes
44

55
.. contents:: Topics
66

7+
v5.0.0
8+
======
9+
10+
Release Summary
11+
---------------
12+
13+
This is release 5.0.0 of ``check_point.gaia``, released on 2023-10-01.
14+
15+
New Modules
16+
-----------
17+
18+
- check_point.gaia.cp_gaia_expert_password – manage expert password of a Check Point machine over Web Services API.
19+
- check_point.gaia.cp_gaia_expert_password_facts – get expert hash password of a Check Point machine over Web Services API.
20+
- check_point.gaia.cp_gaia_time_and_date – manage time and date and timezone of a Check Point machine over Web Services API.
21+
- check_point.gaia.cp_gaia_time_and_date_facts – get time and date and timezone of a Check Point machine over Web Services API.
22+
723
v4.1.1
824
======
925

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ Modules
117117
* `cp_gaia_task_facts` – show task in a Check Point machine over Web Services API.
118118
* `cp_gaia_timezones_facts` – show time zones in a Check Point machine over Web Services API.
119119
* `cp_gaia_version_facts` – show gaia version in a Check Point machine over Web Services API.
120-
120+
* `cp_gaia_expert_password` – manage expert password of a Check Point machine over Web Services API.
121+
* `cp_gaia_expert_password_facts` – get expert hash password of a Check Point machine over Web Services API.
122+
* `cp_gaia_time_and_date` – manage time and date and timezone of a Check Point machine over Web Services API.
123+
* `cp_gaia_time_and_date_facts` – get time and date and timezone of a Check Point machine over Web Services API.
121124

122125
### Code of Conduct
123126
This collection follows the Ansible project's

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: gaia
1010

1111
# The version of the collection. Must be compatible with semantic versioning
12-
version: 4.1.1
12+
version: 5.0.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
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+
25+
DOCUMENTATION = """
26+
author: Ameer Asli (@chkp-ameera)
27+
description:
28+
- Sets expert password.
29+
module: cp_gaia_expert_password
30+
short_description: Sets expert password.
31+
version_added: '5.0.0'
32+
notes:
33+
- Supports C(check_mode).
34+
requirements:
35+
- supported starting from gaia_api >= 1.7
36+
options:
37+
version:
38+
description: Gaia API version for example 1.7.
39+
required: False
40+
type: str
41+
password:
42+
description: expert new password.
43+
required: False
44+
type: str
45+
password_hash:
46+
description: An encrypted representation of the password.
47+
required: False
48+
type: str
49+
"""
50+
51+
52+
EXAMPLES = """
53+
- name: Setting expert new password
54+
check_point.gaia.cp_gaia_expert_password:
55+
password: newpass
56+
"""
57+
58+
59+
RETURN = """
60+
expert_password:
61+
description: The checkpoint object updated.
62+
returned: always.
63+
type: dict
64+
"""
65+
66+
67+
from ansible.module_utils.basic import AnsibleModule
68+
from ansible_collections.check_point.gaia.plugins.module_utils.checkpoint import chkp_api_call, checkpoint_argument_spec_for_all
69+
70+
71+
def main():
72+
# arguments for the module:
73+
fields = dict(
74+
password=dict(type='str', no_log=True),
75+
password_hash=dict(type='str', no_log=True)
76+
)
77+
fields.update(checkpoint_argument_spec_for_all)
78+
module = AnsibleModule(argument_spec=fields, supports_check_mode=True)
79+
api_call_object = 'expert-password'
80+
81+
res = chkp_api_call(module, api_call_object, False)
82+
module.exit_json(**res)
83+
84+
85+
if __name__ == "__main__":
86+
main()
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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+
25+
DOCUMENTATION = """
26+
author: Ameer Asli (@chkp-ameera)
27+
description:
28+
- Show the expert hash password.
29+
module: cp_gaia_expert_password_facts
30+
options:
31+
version:
32+
description: Gaia API version for example 1.7.
33+
required: False
34+
type: str
35+
short_description: Show expert hash password.
36+
version_added: '5.0.0'
37+
notes:
38+
- Supports C(check_mode).
39+
requirements:
40+
- supported starting from gaia_api >= 1.7
41+
42+
43+
"""
44+
45+
46+
EXAMPLES = """
47+
- name: Show expert hash password
48+
check_point.gaia.cp_gaia_expert_password_facts:
49+
50+
51+
"""
52+
53+
54+
RETURN = """
55+
ansible_facts:
56+
description: The checkpoint object facts.
57+
returned: always.
58+
type: dict
59+
contains:
60+
password_hash:
61+
description: An encrypted representation of the password.
62+
returned: always
63+
type: str
64+
"""
65+
66+
67+
from ansible.module_utils.basic import AnsibleModule
68+
from ansible_collections.check_point.gaia.plugins.module_utils.checkpoint import chkp_facts_api_call, checkpoint_argument_spec_for_all
69+
70+
71+
def main():
72+
# arguments for the module:
73+
fields = dict()
74+
fields.update(checkpoint_argument_spec_for_all)
75+
module = AnsibleModule(argument_spec=fields, supports_check_mode=True)
76+
api_call_object = 'expert-password'
77+
78+
res = chkp_facts_api_call(module, api_call_object, False)
79+
module.exit_json(ansible_facts=res["ansible_facts"])
80+
81+
82+
if __name__ == "__main__":
83+
main()
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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+
25+
DOCUMENTATION = """
26+
author: Ameer Asli (@chkp-ameera)
27+
description:
28+
- Show the time and date configuration.
29+
module: cp_gaia_time_and_date
30+
short_description: Show the time and date configuration.
31+
version_added: '5.0.0'
32+
notes:
33+
- Supports C(check_mode).
34+
requirements:
35+
- supported starting from gaia_api >= 1.6
36+
options:
37+
version:
38+
description: Gaia API version for example 1.7.
39+
required: False
40+
type: str
41+
time:
42+
description: Time to set, in HH:MM[:SS] format.
43+
required: False
44+
type: str
45+
date:
46+
description: Date to set, in YYYY-MM-DD format.
47+
required: False
48+
type: str
49+
timezone:
50+
description: Timezone in Area / Region format. See timezone list via cp_gaia_timezones_facts.
51+
required: False
52+
type: str
53+
wait_for_task:
54+
description: Wait for task or return immediately.
55+
required: False
56+
default: True
57+
type: bool
58+
"""
59+
60+
61+
EXAMPLES = """
62+
- name: Setting new time and date
63+
check_point.gaia.cp_gaia_time_and_date:
64+
time: newpass
65+
date: newpass
66+
timezone: newpass
67+
"""
68+
69+
70+
RETURN = """
71+
set_time_and_date:
72+
description: The checkpoint object updated.
73+
returned: always.
74+
type: dict
75+
"""
76+
77+
78+
from ansible.module_utils.basic import AnsibleModule
79+
from ansible_collections.check_point.gaia.plugins.module_utils.checkpoint import checkpoint_argument_spec_for_all
80+
from ansible_collections.check_point.gaia.plugins.module_utils.checkpoint import chkp_api_operation
81+
from ansible_collections.check_point.gaia.plugins.module_utils.checkpoint import checkpoint_argument_spec_for_async
82+
83+
84+
def main():
85+
# arguments for the module:
86+
fields = dict(
87+
time=dict(type='str'),
88+
date=dict(type='str'),
89+
timezone=dict(type='str')
90+
)
91+
fields.update(checkpoint_argument_spec_for_async)
92+
fields.update(checkpoint_argument_spec_for_all)
93+
module = AnsibleModule(argument_spec=fields, supports_check_mode=True)
94+
api_call_object = 'set-time-and-date'
95+
96+
# Run the command:
97+
res = chkp_api_operation(module, api_call_object)
98+
99+
module.exit_json(**res)
100+
101+
102+
if __name__ == "__main__":
103+
main()

0 commit comments

Comments
 (0)