File tree Expand file tree Collapse file tree 8 files changed +167
-6
lines changed
Expand file tree Collapse file tree 8 files changed +167
-6
lines changed Original file line number Diff line number Diff line change 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+
Original file line number Diff line number Diff line change 33IOS_group :
44 platform : " ios"
55
6+ lab-switches :
7+ data :
8+ ntp_server : " 8.8.8.8"
9+
610north_switches :
711 data :
812 ntp_server : " 8.8.8.8"
Original file line number Diff line number Diff line change 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+ ...
Original file line number Diff line number Diff line change 66from nornir_utils .plugins .functions import print_result
77from 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
1111user = input ("Enter your username: " )
1212password = getpass .getpass (prompt = "Enter your password: " )
Original file line number Diff line number Diff line change 55from nornir_utils .plugins .functions import print_result
66from 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
1010user = input ("Enter your username: " )
1111password = getpass .getpass (prompt = "Enter your password: " )
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 88
99devices = [
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
You can’t perform that action at this time.
0 commit comments