-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcp_monitor.yml
42 lines (37 loc) · 1.03 KB
/
cp_monitor.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
---
- name: Check Point "HA" monitoring in Azure Stack
hosts: all
gather_facts: False
vars:
target:
ip: "10.118.250.4"
port: "22"
timeout: "15"
tasks:
- name: Check if primary CP is functioning well
run_once: True
delegate_to: localhost
ignore_errors: True
wait_for:
host: "{{target.ip}}"
port: "{{target.port}}"
timeout: "{{target.timeout}}"
state: "present"
register: output
- name: Print result
run_once: True
delegate_to: localhost
debug:
msg: "Check failed: {{output.failed}}"
##### IF CHECK SUCCEEDS, POINT UDRs TO PRIMARY CHECK POINT GATEWAY #####
- name: Point UDRs to primary Check Point
when: not output.failed
include_tasks: "tasks/set_udr.yml"
vars:
gateway: "{{cp_primary_backend}}"
##### IF CHECK FAILS, POINT UDRs TO SECONDARY CHECK POINT GATEWAY #####
- name: Point UDRs to secondary Check Point
when: output.failed
include_tasks: "tasks/set_udr.yml"
vars:
gateway: "{{cp_secondary_backend}}"