Skip to content

Commit b592308

Browse files
author
TopTalent-23
committed
new scripts
1 parent 5944fea commit b592308

File tree

8 files changed

+167
-6
lines changed

8 files changed

+167
-6
lines changed

config7.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
inventory:
3+
plugin: SimpleInventory
4+
options:
5+
host_file: "inventory/labsw-hosts.yml"
6+
group_file: "inventory/groups.yaml"
7+
defaults_file: "inventory/defaults.yaml"
8+
9+
runner:
10+
plugin: threaded
11+
options:
12+
num_workers: 50
13+

inventory/groups.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
IOS_group:
44
platform: "ios"
55

6+
lab-switches:
7+
data:
8+
ntp_server: "8.8.8.8"
9+
610
north_switches:
711
data:
812
ntp_server: "8.8.8.8"

inventory/labsw-hosts.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
---
2+
3+
lab -sw1:
4+
hostname: "10.10.10.1"
5+
groups:
6+
- IOS_group
7+
- lab-switches
8+
data:
9+
loopback0: "1.1.1.1"
10+
snmp:
11+
snmp_server: "20.20.20.1"
12+
snmp_community: "gh-lab"
13+
ospf:
14+
ospf_rid: 1.1.1.1
15+
ospf_process: "1"
16+
ospf_networks:
17+
ip: "10.10.10.0"
18+
wildcard: "0.0.0.255"
19+
area: "0"
20+
21+
lab -sw2:
22+
hostname: "10.10.10.2"
23+
groups:
24+
- IOS_group
25+
- lab-switches
26+
data:
27+
loopback0: "2.2.2.2"
28+
snmp:
29+
snmp_server: "20.20.20.1"
30+
snmp_community: "gh-lab"
31+
ospf:
32+
ospf_rid: 2.2.2.2
33+
ospf_process: "1"
34+
ospf_networks:
35+
ip: "10.10.10.0"
36+
wildcard: "0.0.0.255"
37+
area: "0"
38+
39+
lab -sw3:
40+
hostname: "10.10.10.3"
41+
groups:
42+
- IOS_group
43+
- lab-switches
44+
data:
45+
loopback0: "3.3.3.3"
46+
snmp:
47+
snmp_server: "20.20.20.1"
48+
snmp_community: "gh-lab"
49+
ospf:
50+
ospf_rid: 3.3.3.3
51+
ospf_process: "1"
52+
ospf_networks:
53+
ip: "10.10.10.0"
54+
wildcard: "0.0.0.255"
55+
area: "0"
56+
57+
lab -sw4:
58+
hostname: "10.10.10.4"
59+
groups:
60+
- IOS_group
61+
- lab-switches
62+
data:
63+
loopback0: "4.4.4.4"
64+
snmp:
65+
snmp_server: "20.20.20.1"
66+
snmp_community: "gh-lab"
67+
ospf:
68+
ospf_rid: 3.3.3.3
69+
ospf_process: "1"
70+
ospf_networks:
71+
ip: "10.10.10.0"
72+
wildcard: "0.0.0.255"
73+
area: "0"
74+
75+
lab -sw5:
76+
hostname: "10.10.10.5"
77+
groups:
78+
- IOS_group
79+
- lab-switches
80+
data:
81+
loopback0: "5.5.5.5"
82+
snmp:
83+
snmp_server: "20.20.20.1"
84+
snmp_community: "gh-lab"
85+
ospf:
86+
ospf_rid: 5.5.5.5
87+
ospf_process: "1"
88+
ospf_networks:
89+
ip: "10.10.10.0"
90+
wildcard: "0.0.0.255"
91+
area: "0"
92+
93+
lab -sw6:
94+
hostname: "10.10.10.6"
95+
groups:
96+
- IOS_group
97+
- lab-switches
98+
data:
99+
loopback0: "6.6.6.6"
100+
snmp:
101+
snmp_server: "20.20.20.1"
102+
snmp_community: "gh-lab"
103+
ospf:
104+
ospf_rid: 6.6.6.6
105+
ospf_process: "1"
106+
ospf_networks:
107+
ip: "10.10.10.0"
108+
wildcard: "0.0.0.255"
109+
area: "0"
110+
111+
lab -sw7:
112+
hostname: "10.10.10.7"
113+
groups:
114+
- IOS_group
115+
- lab-switches
116+
data:
117+
loopback0: "7.7.7.7"
118+
snmp:
119+
snmp_server: "20.20.20.1"
120+
snmp_community: "gh-lab"
121+
ospf:
122+
ospf_rid: 7.7.7.7
123+
ospf_process: "1"
124+
ospf_networks:
125+
ip: "10.10.10.0"
126+
wildcard: "0.0.0.255"
127+
area: "0"
128+
129+
lab -sw8:
130+
hostname: "10.10.10.8"
131+
groups:
132+
- IOS_group
133+
- lab-switches
134+
data:
135+
loopback0: "8.8.8.1"
136+
snmp:
137+
snmp_server: "20.20.20.1"
138+
snmp_community: "gh-lab"
139+
ospf:
140+
ospf_rid: 8.8.8.1
141+
ospf_process: "1"
142+
ospf_networks:
143+
ip: "10.10.10.0"
144+
wildcard: "0.0.0.255"
145+
area: "0"
146+
...

nornir-cdp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from nornir_utils.plugins.functions import print_result
77
from nornir_scrapli.tasks import send_configs
88

9-
nr = InitNornir(config_file="config6.yaml")
9+
nr = InitNornir(config_file="config7.yaml")
1010
#The above line is telling nornir where the config file is located
1111
user = input("Enter your username: ")
1212
password = getpass.getpass(prompt="Enter your password: ")

nornir-cdpneigh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from nornir_utils.plugins.functions import print_result
66
from rich import print as rprint
77

8-
nr = InitNornir(config_file="config.yaml")
8+
nr = InitNornir(config_file="config7.yaml")
99
#The above line is telling nornir where the config file is located
1010
user = input("Enter your username: ")
1111
password = getpass.getpass(prompt="Enter your password: ")

nornir_netmiko

Lines changed: 0 additions & 1 deletion
This file was deleted.

nornir_utils

Lines changed: 0 additions & 1 deletion
This file was deleted.

scrapli-test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
devices = [
1010
{
11-
"host": "NN-SW-01",
11+
"host": "lab-sw1",
1212
"auth_username": "cisco",
1313
"auth_password": "cisco123",
1414
"auth_strict_key": False,
15-
"ssh_config_file": True,
15+
"ssh_config_file": True
1616
}
1717
]
1818
# above, creating an object called devices to hold the hostname and credentials that scrapli will use to connect

0 commit comments

Comments
 (0)