forked from apoletics/ansible-network-check
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.yaml
37 lines (30 loc) · 937 Bytes
/
main.yaml
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
- name: Ansible Network Acceessibility Check
hosts: localhost
ignore_errors: true
vars_files:
- port_definition.yaml
tasks:
- name: print var
debug:
var: port_definitions
- name: Defining fact initialization
include_tasks: "tasks/init_phases.yaml port_definition={{item_port}}"
with_items: "{{port_definitions}}"
loop_control:
loop_var: item_port
run_once: true
- name: Testing Ports
include_tasks: "tasks/start_port_check.yaml port_definition={{item_port}}"
with_items: "{{port_definitions}}"
loop_control:
loop_var: item_port
run_once: true
# - name: Ensure no existing process running
# shell: |
# for PIDFILE in $(ls /tmp/ansible_network_health_check*/*PID); do
# kill -9 $(cat $PIDFILE)
# done
# exit 0
# - name: ensure tmp folder doesnot exist for clean start
# shell: |
# rm -rf /tmp/ansible_network_health_check*