cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Bookmark
|
Subscribe
|
139
Views
0
Helpful
1
Replies

Velocity template testing on device tag

HansK_NL
Level 1
Level 1

We are looking for a way to establish whether or not a SSD is present in a Cat9300 switch, but haven't found a solution, yet.

We found a post referring to the possibility to test for a tag assigned to an interface interface.getTag("") and were wondering if something like this is also possible on the device level.

From the inventory page of DNAC we've assigned a tag named "SSD" to a switch having a SSD plugged in.

From a template we would like to test for this tag and then add some additional commands to the CLI of said switch:

#if($__device.getTag("SSD"))
ip http secure-active-session-modules webui
ip http session-module-list webui NG_WEBUI
ip http session-module-list pki OPENRESTY_PKI
ip http active-session-modules pki
#end

The above code does NOT work.

Is this possible and what would be the best way to do this?

Cheers

 

 

 

1 Reply 1

Torbjørn
VIP
VIP

Hello @HansK_NL,

I would probably make this part of the config a separate template that you can assign to a specific device tag in your network profile. AFAIK the getTag method does not work in Cat-C velocity templating. Note that applying templates to specific device tags does not work if you put it in a composite template.

Happy to help! Please mark as helpful/solution if applicable.
Get in touch: https://torbjorn.dev