-
Notifications
You must be signed in to change notification settings - Fork 31
/
main.yaml
40 lines (34 loc) · 960 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
37
38
39
40
- 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/init_phases.yaml"
vars:
port_definition: "{{item_port}}"
with_items: "{{ port_definitions }}"
loop_control:
loop_var: item_port
run_once: true
- name: Testing Ports
include: "tasks/start_port_check.yaml"
vars:
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*