cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
447
Views
5
Helpful
2
Replies

DNA-Center templating wlan profile / policyprofile

merilcerpos
Level 1
Level 1

we are trying with velocity templating to change settings in already existing wlan profiles and policy profiles. The challenge is, that DNA-Center is pushing the wlan profiles/policy profiles with the configured name + a suffix, which is varying per site like "test1234_Global_FL_26fa80bc" for policy profile testprofile12345678

how can the policy profile be accessed dynamically? $__policyprofile.profileName variable is existing, but i don't know how to proceed with that

 

and wlan test1234_Global_FL_26fa80bc 17 test12345678

how can the wlan profile be accessed equivalent to policy profile? $__wlan.profileName

 

is there a detailed documentation available for templating with velocity in DNA-Center?

 

thank you

2 Replies 2

Preston Chilcote
Cisco Employee
Cisco Employee

There are some good example scripts published on devnet, but I don't know that they include wireless templates.

 

To figure out how the template variable are actually structured, try creating a blank template with just the name of the variable, such as:

 

$__ssid

$__policyprofile

 

Then, save, and run a simulation.  The simulator will give you the option to select a test device so that you can see how the system variables actually get rendered.  My test of the above two returned:

 

[{ssidName=9800CMX-PSK, wlanId=17, status=provisioned, designSsid=9800CMX-PSK, siteId=00eb82da-6b3a-4c7f-95c0-6b6b9e2fb843, siteName=null, siteProfileUuids=2b3c6a6c-5053-4c85-b587-09fb9353d97b, policyProfiles=9800CMX-PS_Global_NF_9e33628b, wlanProfileName=null, policyProfileName=null, isFabric=false}]

[default-policy-profile, 9800CMX-PS_Global_NF_9e33628b]

 

So we can see they are both lists.  The second line is probably more what you're looking for and easier to parse.  

 

Now we can loop through the list in our template:

 

#foreach($prof in $__policyprofile)

   $prof

#end

 

When we run the simulator again, we'll get this, which shows that you can use the variable $prof in any confrm commands you need within the foreach loop:

 

   default-policy-profile

   9800CMX-PS_Global_NF_9e33628b

 

This hopefully answers the question for 9800's.  If you need the same for Aireos profiles, you can try using a similar process to poke around at the provided system variables.

usaf_27
Level 1
Level 1

I run into this all the time and I as well use a CLI template too modify the profile polices and the WLAN settings. All because DNAC does not have all the settings in the GUI to provide me the final configuration on the controller.  

What I do is leverage the bind to source feature. This allows DNAC to pull in the profile policy names into your template provisioning process.  But first, you have to run through an initial provisioning process so DNAC can push out long complicated profile policy names.  Then re-provision again with your respective template to feed in those profile names. Then obviously the template has the configuration you want for each policy profile.