forked from network-automation/net_check
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnet_lightbulb.yml
64 lines (57 loc) · 1.41 KB
/
net_lightbulb.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
---
- hosts: routers
gather_facts: no
connection: local
vars:
ansible_network_os: ios
tasks:
- name: GigabitEthernet1 interface up
net_interface:
name: GigabitEthernet1
state: up
register: test1
ignore_errors: yes
- name: Tunnel0 interface up
net_interface:
name: Tunnel0
state: up
register: test2
ignore_errors: yes
- name: Test reachability across tunnel rtr1->rtr2
net_ping:
dest: "10.0.0.2"
when: inventory_hostname == "rtr1"
register: test3
ignore_errors: yes
- name: Test reachability across tunnel rtr2->rtr1
net_ping:
dest: "10.0.0.1"
when: inventory_hostname == "rtr2"
register: test4
ignore_errors: yes
- name: Test reachability to ansible
net_ping:
dest: "{{hostvars['ansible']['private_ip']}}"
register: test5
ignore_errors: yes
- name: Test reachability to host1
net_ping:
dest: "{{hostvars['host1']['private_ip']}}"
register: test6
ignore_errors: yes
- name: create HTML report
template:
src: report.j2
dest: ./generated_report.html
delegate_to: localhost
run_once: true
# - name: debug outputs
# debug:
# var: "{{item}}"
# with_items:
# - test1
# - test2
# - test3
# - test4
# - test5
# - test6