-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathdemo-playbook.yml
81 lines (81 loc) · 2.36 KB
/
demo-playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
- hosts: 127.0.0.1
tasks:
- name: login
check_point_mgmt:
command: login
parameters:
username: '{{mgmt_user}}'
password: '{{mgmt_password}}'
management: '{{mgmt_server}}'
fingerprint: 5658166D6216B903EC1EA0535B1708CDE206ED14
register: login_response
- name: add host
check_point_mgmt:
command: add-host
parameters:
name: host_demo_1
ip-address: 1.1.1.1
session-data: '{{login_response}}'
- name: add host
check_point_mgmt:
command: add-host
parameters:
name: host_demo_2
ip-address: 1.1.1.2
session-data: '{{login_response}}'
- name: add new host new existing group
check_point_mgmt:
command: set-group
parameters:
name: group_demo
members:
add:
- host_demo_1
- host_demo_2
session-data: '{{login_response}}'
- name: create new tcp service
check_point_mgmt:
command: add-service-tcp
parameters:
name: tcp_1005
port: '1005'
session-data: '{{login_response}}'
- name: create a section called 'script rules'
check_point_mgmt:
command: add-access-section
parameters:
layer: Network
name: script rules
position: 1
session-data: '{{ login_response }}'
- name: create rule at the top of a section called 'script rules'
check_point_mgmt:
command: add-access-rule
parameters:
layer: network
name: created by ansible playbook
position:
top: script rules
source:
- group_demo
destination:
- host_demo_1
- host_demo_2
service:
- tcp_1005
action: accept
session-data: '{{login_response}}'
- name: publish
check_point_mgmt:
command: publish
session-data: '{{login_response}}'
- name: install policy
check_point_mgmt:
command: install-policy
parameters:
policy-package: standard
session-data: '{{login_response}}'
- name: logout
check_point_mgmt:
command: logout
session-data: '{{login_response}}'