01-13-2023 12:46 AM
My Issue is that I need to update NTP server settings on my 9300 switch estate.
I have dnac deployed but we are only using it for assurance and swim at the moment, and I would like to use it to get a better understanding on how to make changes using velocity in dnac.
This is what I need to deploy but because some of my sites have slightly different interfaces I need to do an if and ifelse statement.
ntp authentication-key 1 md5 MD5 *************
ntp authenticate
ntp trusted-key 1
ntp source Loopback2
ntp server 192.168.198.20 key 1
I can not get my head around what the config will look like, as this is what I thought the format would be.
#if( $interface == "Loopback2" )
ntp authentication-key 1 md5 MD5 ***********************
ntp authenticate
ntp trusted-key 1
ntp source Loopback2
ntp server 192.168.198.20 key 1
#elseif( $interface == "Vlan 50" )
ntp authentication-key 1 md5 MD5 ***********************
ntp authenticate
ntp trusted-key 1
ntp source Vlan 50
ntp server 192.168.198.20 key 1
#elseif( $interface == "Vlan 20" )
ntp authentication-key 1 md5 MD5 ***********************
ntp authenticate
ntp trusted-key 1
ntp source Vlan 20
ntp server 192.168.198.20 key 1
#end
Any help would be much appreciated.
01-13-2023 01:48 AM
- Checkout if this example could be helpful :
#if( $interface == "$Loopback2" )
ntp authentication-key 1 md5 $md5Key
ntp authenticate
ntp trusted-key 1
ntp source $interface
ntp server $ntpServer key 1
#elseif( $interface == "$Vlan50" )
ntp authentication-key 1 md5 $md5Key
ntp authenticate
ntp trusted-key 1
ntp source $interface
ntp server $ntpServer key 1
#elseif( $interface == "$Vlan20" )
ntp authentication-key 1 md5 $md5Key
ntp authenticate
ntp trusted-key 1
ntp source $interface
ntp server $ntpServer key 1
#end
M.
01-13-2023 06:11 AM
01-13-2023 09:27 AM
Garry, If you haven't provisioned templates before, I think you would benefit from meeting with your Cisco Customer Success Representative. Your account team can introduce you. They can walk you through how the feature works.
You should use the Simulation Editor tool to make sure the config looks correct after variables have been populated. It probably makes sense to make $interface a SingleSelect dropdown variable so that the user can pick the interface name from a list, which eliminates typos.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide