05-21-2020 02:19 PM - edited 06-02-2020 11:44 AM
The template editor is a standalone application that can be used to Build your Day-0 (PnP) or Day-N configurations.
•Day-0 (PnP) : Is your PnP/Onboarding Template . This is a one-time Template that used while you onboard your network devices, this template are Pushed to the Network devices as once (Bulk Template) .Usually we recommend to Push all your Major Connectivity config using This Template.
Note:If DNAC Management interface need to be changed from the PnP discovery interface to any other interface, make sure to use : “ip http client source-interface”. **Managed I interface need to be reachable via DNAC.
•Day-N: Is your Provisioning Template. This is the template that you can use to change any Configuration after your device is Managed by DNAC, this template are Push to the Network device in a line by line cli basis , make sure to not touch any basic connectivity or you will lose connectivity to the device.
•Click ‘+’ and select Create Template
•Enter Template variables
•After Add a New Template is completed the Template Editor is opened
•The following basic Actions are available
•The following basic Edit options are available
Template Type Comparison
Description |
Regular Template |
Composit Template |
Number of Template |
One Template |
One or more regualr template |
Apply To |
Day0/DayN |
DayN only |
Easy to Manage/Troublshoot |
Ok |
Easier |
All commands are entered in conf t mode. As commands are delivered a prompt is expected after each command. This complicates thing, here you can find use cases and solutions to address the need :
Note: All the commands executed via templates are always in conf t mode. So there is no need to specify the enable / conf t command explicitly in the template.
Adding Enable Mode Commands
Use this syntax to add enable mode commands to your CLI templates:
Note: You need to specify #MODE_ENABLE if you want to execute any command outside the conf t.
Adding interactive Mode Commands
An interactive command contains the expected cli query and input that must be entered following the execution of a command.
To enter interactive command mode
To enter an interactive command in the CLI Content area, use the following syntax:
CLI Command<IQ>interactive question 1<R>command response 1 <IQ>interactive question 2<R>command response 2
Where Interactive Question <IQ> and Response <R> tags are case-sensitive and must be entered in uppercase.
For example:
Note: You need to specify #MODE_ENABLE if you want to execute any command outside the conf t.
Combining Interactive Enable Mode Commands
Use this syntax to combine interactive Enable Mode commands:
#MODE_ENABLE
#INTERACTIVE
commands<IQ>interactive question<R>response
#ENDS_INTERACTIVE
#MODE_END_ENABLE
For example:
Note: All the templates in the PI system will work here also, except the multi line tag<MLTD>.
•Variables Value can Be validated against different format ( String ,IP ,integer, etc..)
•Variable Value can Bind to source – I don’t recommend as its not reliable •sometimes its not working.unless you are sure and you test this option against your •Hardware running release don't go with this approach.
•Commit will prompt you to save , no need to save and Commit
Templates are a composite of Cisco CLI, and velocity
•Configure hostname
hostname $name
•Configure Macro
Split the comma delimited Text string into a string list..
Example :
$data_vlanids = 200,300
$vlans list = [200,300]
Replace function is very useful to trim any spaces in an input variable
•On multiple device on-boarding scenario, rather than selecting each device and fill their variables , you can export Form variable into *.csv file,Fill it in excel and import it back.
•On testing/troubleshooting scenario , it will reduce your time by importing the excel rather than fill in the variable every trial.
Note: Excel sheet Column will be head of device serial number.
abdeabdu@cisco.com : Can you update us with the JInja Template as well ?
Regards
Inderdeep Singh
www.thenetworkdna.com ( Awarded by Cisco IT Blogs award 2020)
thank you for a very informative article.
I have a question about Composite templates. I have two templates in my Composite template and I would like to use a variable from Template1 in Template2. Is there a way how to do it?
Thank you,
Bret
Great article. Thanks for the useful nuggets of information. It would be nice if the screenshots were better resolution.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: