forked from jeremycohoe/IOSXE-Zero-Touch-Provisioning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathztp-simple.py
17 lines (14 loc) · 785 Bytes
/
ztp-simple.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
print "\n\n *** Sample ZTP Day0 Python Script *** \n\n"
# Importing cli module
import cli
print "Configure vlan interface, gateway, aaa, and enable netconf-yang\n\n"
cli.configurep(["int vlan 1", "ip address 10.5.123.27 255.255.255.0", "no shut", "end"])
cli.configurep(["ip default-gateway 10.5.123.1", "end"])
cli.configurep(["username admin privilege 15 secret 0 XXXXXXXXXXXXX"])
cli.configurep(["aaa new-model", "aaa authentication login default local", "end"])
cli.configurep(["aaa authorization exec default local", "aaa session-id common", "end"])
cli.configurep(["netconf-yang", "end"])
print "\n\n *** Executing show ip interface brief *** \n\n"
cli_command = "sh ip int brief"
cli.executep(cli_command)
print "\n\n *** ZTP Day0 Python Script Execution Complete *** \n\n"