Log in to ask questions, share your expertise, or stay connected to content. Don’t have a login? Join now.
Problem:
Template :
#This template is imported from device "Switch-PFR1" with serial "SG07KN501D" ! !Version ArubaOS-CX FL.10.06.0120 !export-password: default hostname %_sys_hostname% user admin group administrators password plaintext ***** ntp enable ! ! ! ! ssh server vrf default ssh server vrf mgmt vsf member 1 type jl666a vlan 1,100 spanning-tree interface mgmt no shutdown ip dhcp interface 1/1/1 no shutdown no routing vlan access 1 interface 1/1/2 no shutdown no routing vlan access 1 interface 1/1/3 no shutdown no routing vlan access 1 interface 1/1/4 no shutdown no routing vlan access 1
Switch-PFR1 Truncated Config :
Switch-PFR1# sh running-config Current configuration: ! !Version ArubaOS-CX FL.10.06.0120 !export-password: default hostname Switch-PFR1 user admin group administrators password ciphertext AQBapa54LU8IuF38JPo3XMsO0pPskObnPlWLfJf5+CmgKOlEYgAAAEHGhhVbCiC2j8/XyqHEz5glvCOyVWmTq2O732DbO7YFTEGqvEIeizuu1K8FJCx51gMXjpMsEN1ZJvjQGQ6dTeAv1ewMvMCs8Kf+CeoL05cONOXfBMgsHMXzeaZKpL/6gsQU ntp enable ! ! ! ! ssh server vrf default ssh server vrf mgmt vsf member 1 type jl666a vlan 1,100 spanning-tree interface mgmt no shutdown ip dhcp interface 1/1/1 no shutdown no routing vlan access 1 interface 1/1/2 no shutdown no routing vlan access 1
Switch-PFR2 Truncated Config :
Switch-PFR2# sh running-config Current configuration: ! !Version ArubaOS-CX FL.10.06.0120 !export-password: default hostname Switch-PFR2 user admin group administrators password ciphertext AQBapWBG9gMpFfHfkzSWm2JcGCyZ6cOq4djFaMi79zDPpK1mYgAAAD8zPmCStR6LYXfbfYu0oKMk1FnwCkUMZhnfVcTraEYVF5IjDiP6qOkSrhb/9NUugCd8BW9mNp2qlr2u4UuBaGT7R3bOJMb1ifVMhfEI/Yvg/T7ufc2Z1SZblNi3ZCMSSZKY ntp enable ! ! ! ! ssh server vrf default ssh server vrf mgmt vsf member 1 type jl666a vlan 1,100 spanning-tree interface mgmt no shutdown ip dhcp interface 1/1/1 no shutdown no routing vlan access 1 interface 1/1/2 no shutdown no routing vlan access 1
1. Using If else statement in the template.
2. Using a variable in the template.
Method 1 : Using If else statement in the template.
%if _sys_hostname=Switch-PFR2% interface 1/1/2 no shutdown no routing vlan access 100 %else% interface 1/1/2 no shutdown no routing vlan access 1 %endif%
Verification :
Method 2 : Using a variable in the template.
Devices > Switches > Config > Variables > Download Variables
interface 1/1/2 no shutdown no routing vlan access %var%
© Copyright 2024 Hewlett Packard Enterprise Development LPAll Rights Reserved.