Velocity template testing on device tag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 01:12 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 01:56 AM
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.
Get in touch: https://torbjorn.dev
