-
Notifications
You must be signed in to change notification settings - Fork 3
/
ceos-startup.cfg
55 lines (46 loc) · 2.34 KB
/
ceos-startup.cfg
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
aaa authorization exec default local
aaa authentication policy local allow-nopassword-remote-login
username admin privilege 15 role network-admin nopassword
username mtache privilege 15 role network-admin nopassword
hostname campus-{{ .ShortName }}
{{- if .Env.CLAB_MGMT_VRF }}
vrf instance {{ .Env.CLAB_MGMT_VRF }}
{{end}}
{{ if .MgmtIPv4Gateway }}ip route {{ if .Env.CLAB_MGMT_VRF }}vrf {{ .Env.CLAB_MGMT_VRF }} {{end}}0.0.0.0/0 {{ .MgmtIPv4Gateway }}{{end}}
{{ if .MgmtIPv6Gateway }}ipv6 route {{ if .Env.CLAB_MGMT_VRF }}vrf {{ .Env.CLAB_MGMT_VRF }} {{end}}::0/0 {{ .MgmtIPv6Gateway }}{{end}}
interface {{ .MgmtIntf }}
{{ if .Env.CLAB_MGMT_VRF }} vrf {{ .Env.CLAB_MGMT_VRF }}{{end}}
{{ if .MgmtIPv4Address }}ip address {{ .MgmtIPv4Address }}/{{.MgmtIPv4PrefixLength}}{{end}}
{{ if .MgmtIPv6Address }}ipv6 address {{ .MgmtIPv6Address }}/{{.MgmtIPv6PrefixLength}}{{end}}
no lldp receive
no lldp transmit
daemon TerminAttr
exec /usr/bin/TerminAttr -cvaddr=apiserver.cv-staging.corp.arista.io:443 -cvauth=token-secure,/mnt/flash/cv-onboarding-token -cvvrf={{ .Env.CLAB_MGMT_VRF }} -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -ingestexclude=/Sysdb/cell/1/agent,/Sysdb/cell/2/agent -taillogs
no shutdown
ip name-server vrf MGMT 8.8.8.8
event-handler ConfigureHardwareModel
trigger on-boot
action bash
python -m Acons Sysdb << EOF
cd /ar/Sysdb/hardware/entmib
if (model := os.getenv('MODEL_NAME')):
_.fixedSystem.modelName = model
elif (model := os.getenv('CHASSIS_MODEL_NAME')):
_.chassis = (1,0,'Chassis')
_.chassis.modelName = model
for var, value in os.environ.items():
if var.startswith('CHASSIS'):
keys = var.split('_')
if keys[1] == "SUPERVISOR":
i = int(keys[2])
_.chassis.cardSlot.newMember(100002000+i, i, 'Supervisor')
_.chassis.cardSlot[i].card = (100002100+i, i, 'Supervisor')
_.chassis.cardSlot[i].card.modelName = value
elif keys[1] == "LINECARD":
i = int(keys[2]) + 2
_.chassis.cardSlot.newMember(100002000+i, i, 'Linecard')
_.chassis.cardSlot[i].card = (100002100+i, i, 'Linecard')
_.chassis.cardSlot[i].card.modelName = value
print(f"Hardare model has been set to {model}")
EOF
!