cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
653
Views
0
Helpful
3
Replies

DNAC Velocity Templates Understanding

Garry Cooper
Level 1
Level 1

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.

3 Replies 3

marce1000
VIP
VIP

 

      - 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.



-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
    When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '

 Marce1000

Thanks for the reply.

Applied that now on the next screen not sure what or where to add my setting.

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.

Review Cisco Networking for a $25 gift card