| 1 |
# Check Point Ansible Mgmt Collection |
| 2 |
This Ansible collection provides control over a Check Point Management server using |
| 3 |
Check Point's web-services APIs. |
| 4 |
|
| 5 |
The Ansible Check Point modules reference can be found here: |
| 6 |
[Ansible Check Point modules reference](https://docs.ansible.com/ansible/latest/collections/check_point/mgmt/index.html) |
| 7 |
<br>Note - look only at the `cp_mgmt_*` modules, because the `checkpoint_*` will be deprecated. |
| 8 |
|
| 9 |
This is the repository of the mgmt collection which can be found here: [Galaxy: check_point.mgmt](https://galaxy.ansible.com/check_point/mgmt) |
| 10 |
|
| 11 |
Installation instructions |
| 12 |
------------------------- |
| 13 |
Run `ansible-galaxy collection install check_point.mgmt` |
| 14 |
|
| 15 |
Requirements |
| 16 |
------------ |
| 17 |
* Ansible 2.9+ is required. |
| 18 |
* The Check Point server should be using the versions detailed in this SK: [Check Point Support SK114661](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk114661) |
| 19 |
* The Check Point server should be open for API communication from the Ansible server. |
| 20 |
Open SmartConsole and check "Manage & Settings > Blades > Management API > Advanced settings". |
| 21 |
|
| 22 |
Usage |
| 23 |
----- |
| 24 |
1. Edit the `hosts` so that it will contain a section similar to this one: |
| 25 |
``` |
| 26 |
[check_point] |
| 27 |
%CHECK_POINT_MANAGEMENT_SERVER_IP% |
| 28 |
[check_point:vars] |
| 29 |
ansible_httpapi_use_ssl=True |
| 30 |
ansible_httpapi_validate_certs=False |
| 31 |
ansible_user=%CHECK_POINT_MANAGEMENT_SERVER_USER% |
| 32 |
ansible_password=%CHECK_POINT_MANAGEMENT_SERVER_PASSWORD% |
| 33 |
ansible_network_os=check_point.mgmt.checkpoint |
| 34 |
``` |
| 35 |
Note - If you want to run against Ansible version 2.9 instead of the collection, just replace `ansible_network_os=check_point.mgmt.checkpoint` with `ansible_network_os=checkpoint` |
| 36 |
<br><br>2. Run a playbook: |
| 37 |
```sh |
| 38 |
ansible-playbook your_ansible_playbook.yml |
| 39 |
``` |
| 40 |
or |
| 41 |
|
| 42 |
Run a playbook in "check mode": |
| 43 |
```sh |
| 44 |
ansible-playbook -C your_ansible_playbook.yml |
| 45 |
``` |
| 46 |
Example playbook: |
| 47 |
``` |
| 48 |
--- |
| 49 |
- name: playbook name |
| 50 |
hosts: check_point |
| 51 |
connection: httpapi |
| 52 |
tasks: |
| 53 |
- name: task to have network |
| 54 |
check_point.mgmt.cp_mgmt_network: |
| 55 |
name: "network name" |
| 56 |
subnet: "4.1.76.0" |
| 57 |
mask_length: 24 |
| 58 |
auto_publish_session: true |
| 59 |
|
| 60 |
vars: |
| 61 |
ansible_checkpoint_domain: "SMC User" |
| 62 |
``` |
| 63 |
Note - If you want to run against Ansible version 2.9 instead of the collection, just replace `check_point.mgmt.cp_mgmt_network` with `cp_mgmt_network` |
| 64 |
|
| 65 |
### Notes: |
| 66 |
1. Because this Ansible module is controlling the management server remotely via the web API, |
| 67 |
the Ansible server needs to have access to the Check Point API server. |
| 68 |
Open `SmartConsole`, navigate to "Manage & Settings > Blades > Management API > Advanced settings" |
| 69 |
and check the API server's accessibility set |
| 70 |
2. Ansible has a feature called "Check Mode" that enables you to test the |
| 71 |
changes without actually changing anything. |
| 72 |
3. The login and logout happens automatically. |
| 73 |
4. If you want to login to a specific domain, in the playbook above in the `vars`section change the domain name to |
| 74 |
`ansible_checkpoint_domain` |
| 75 |
5. There are two ways to publish changes: |
| 76 |
a. Set the `auto_publish_session` to `true` as displayed in the example playbook above. |
| 77 |
This option will publish only the task which this parameter belongs to. |
| 78 |
b. Add the task to publish to the `cp_mgmt_publish` module. |
| 79 |
This option will publish all the tasks above this task. |
| 80 |
6. It is recommended by Check Point to use this collection over the modules of Ansible version 2.9 |
| 81 |
7. If you still want to use Ansible version 2.9 instead of this collection (not recommended): |
| 82 |
a. In the `hosts` file replace `ansible_network_os=check_point.mgmt.checkpoint` with `ansible_network_os=checkpoint` |
| 83 |
b. In the task in the playbook replace the module `check_point.mgmt.cp_mgmt_*` with the module `cp_mgmt_*` |
| 84 |
8. Starting from version 1.0.6, when running a command which returns a task-id, and the user chooses to wait for that task to finish |
| 85 |
(the default is to wait), then the output of the command will be the output of the show-task command (instead of the task-id). |
| 86 |
|
| 87 |
### Testing |
| 88 |
This collection is tested with the most current Ansible releases. Ansible versions from 2.15.0 and above are supported. |
| 89 |
|
| 90 |
### Support |
| 91 |
As Red Hat Ansible Certified Content, this collection is entitled to support regarding issues or requests for enhancements |
| 92 |
through the collection's GitHub repository using the **New issue** button in the top right corner: [GitHub Issues](https://github.com/CheckPointSW/CheckPointAnsibleMgmtCollection/issues) |
| 93 |
|
| 94 |
### Release Notes |
| 95 |
[Release Notes (CHANGELOG.rst)](https://github.com/CheckPointSW/CheckPointAnsibleMgmtCollection/blob/master/CHANGELOG.rst) |
| 96 |
|
| 97 |
### Related Information |
| 98 |
For further information please see - [Check Point Support SK114661](https://support.checkpoint.com/results/sk/sk114661) |
| 99 |
|
| 100 |
### License Information |
| 101 |
Apache-2.0 license |