Add Configuration Templates
In CSO releases before Release 5.1.0, configuration templates are called stage-2 configuration templates.
In Customer Portal, users with the Tenant Administrator role can add a configuration template by providing the device configuration using the Jinja template language syntax.
Before you add the configuration template, ensure that you have the device configuration ready.
We recommend that you use a working configuration on the device to add the configuration template.
To add a configuration template:
- Select Resources > Templates > Configuration Templates.
The Configuration Templates page appears.
- Click the + (add) icon.
The Add Configuration Template page (wizard) appears.
Fields marked with an asterisk (*) are mandatory.
- Configure the fields on the Basic Information tab according
to the guidelines provided in Table 1.
Click Next to go to the Templatize Config tab.
- Add the configuration on the Templatize Config tab. Refer
to Table 2 for
an explanation of the actions on this tab
Click Next to go to the Customize Variables tab, where the template parameters that you configured are displayed in a grid.
- You can modify the parameters for one or more rows as
- Click inside a row to modify the values for the fields in that row according to the guidelines provided in Table 3.
- Click √ (check mark) to save your changes or X to discard the changes.
After you are finished, click Next to go to the Generated UI tab, where the UI for the variables that you entered is generated and displayed after a few seconds.
- Perform one or more actions on this tab, as explained in Table 4.
- Click OK.
The configuration template is added and you are returned to the Configuration Templates page, where a confirmation message is displayed. You can assign the configuration template to device templates or deploy the template on devices.
Table 1: Basic Information Settings (Add Configuration Template Page)
Enter a unique name that can only contain alphanumeric characters and hyphens; 15-character maximum.
Enter a description for the configuration template.
Select the output configuration format for the template:
Select the device family for which you are adding the template; for example, juniper-nfx.
Click Next to continue.
Table 2: Templatize Config Actions (Add Configuration Template Page)
View the sample configuration and detected template variables
The Templatize Config tab displays a sample Jinja configuration template in an inline editor on the left and the corresponding template variables in the Detected Template Variables pane on the right.
Download a sample configuration
You can download a sample configuration by clicking the here link near the top of the tab.
Add the device configuration
To add the device configuration:
If the template variables detected match the configuration that you added to the template, click Next to continue.
CSO validates the Jinja template and displays an error message if there are any errors.
Table 3: Customize Variables Settings (Add Configuration Templates Page)
Displays the name of the detected variable. You cannot edit the name.
Select the data type for the variable:
Note: You cannot specify a data type for a top-level variable that has one or more leaf nodes under it.
Select this check box if the variable is to be used as a key.
Keys are unique identifiers used in defining list entries in the Yang data hierarchy. They help distinguish one list entry from another.
Note: For lists, you must define a key.
Select this check box if you want the parameter to be mandatory.
Enter a default value for the variable.
For data types string or number, specify one of the following:
If you selected entered enumerated values, the values are displayed here. Click inside the field to edit the enumerated values (in the Edit enumeration for variable-name page that appears).
Note: This field can be configured only for the root-level (top-level) node.
Select the scope of the parameter:
Enter a meaningful description for the variable; for example, Gateway IP address.
After you finish customizing the parameters, click Next.
Table 4: Generated UI Actions (Add Configuration Template Page)
Reorder the UI
Drag and drop individual fields, grids, or sections to change the order in which the variables appear in the UI.
Modify the settings for a section
Modify the settings for a field
Modify the settings for a grid
Reset the generated UI
Click Undo all edits to discard the changes that you made and undo the changes made in the UI.
Validate and render the configuration
Validating the template and rendering the configuration enables you to check the configuration template that you added.
To validate and render a configuration template:
After you are finished checking the configuration, click Next to continue.