Space banner This version of the product is in limited support. However, the documentation is available for your convenience. You will not be able to leave comments.

Adding a template


To add a template to your environment, you can choose one of the following methods:

Templates can also reference command-line substitution parameters that the server resolves when merging or restoring a template to a device. The template below uses a global substitution parameter referenced as ${global.logServer1}.

Creating a new template

On the Network > Scripts > Templates page, click Add and do the following:

  1. In the Details tab, enter information in the following fields:
    • Name: Enter a unique name to identify the template.
    • Annotation: (Optional) Enter an annotation to identify the template.
    • Validate Substitution Parameters: (Optional) Select this option if TrueSight Network Automation should validate substitution parameter syntax before saving the template. For more information, see Using-substitution-parameters-in-templates.
  2. Click the Contents tab to define the template contents. 
    A template can contain the contents of multiple scripts. Each script has a unique Device Type and OS version. This enables you to organize common scripts across multiple vendors as a single template. For more information, see Understanding-template-formatting.
  3. To add a script, click Add.
  4. Enter the following information, as needed:
    • Vendor and Device Type: Select the vendor and the device type compatible with this template.
    • Minimum OS Version: Enter the minimal OS version for which this Template is compatible. Enter * to specify any major, minor, or build.
    • Maximum OS Version: Enter the maximum OS version for which this Template is compatible. Enter * to specify any major, minor, or build.
    • Injection Template: Select this check box if you want to inject the Deploy to Active action with device type command elements, such as interactionhttpinteractioncondition, or loops and modify the device configuration by using APIs. For more information about injection templates, see Changing device configurations.
    • Contents: Enter the configuration commands that are to be sent to a device during a Deploy to Stored or Deploy to Active operation. If you have copied an existing configuration, ensure that device specific configuration parameters (for example, host name) are changed to match the target device.
    • Substitution Parameters: Insert substitution parameters, as described in Using-substitution-parameters-in-templates.

      Contents.png

  5. When you are finished entering the script, click Enter and then click Save.
    The script is added to the template.

Creating a template based on an existing configuration

  1. Open the device with the desired configuration for editing, as described in Editing-devices.
  2. Select the Configurations tab.

    AddTemp_SelectConfig.png
  3. Select a Running, Startup, or other appropriate configuration, and click Create Template. Click OK when prompted. to confirm the creation of template.
    The configuration file is copied to the Contents tab of the new template. The Add Template page is displayed.
  4. In the Details tab, enter information in the following fields:
    • Name: Enter a unique name to identify the template.
    • Annotation: (Optional) Enter an annotation to identify the template.
    • Validate Substitution Parameters: (Optional) Select if Network Automation should validate substitution parameter syntax before saving the template. For more information, see Using-substitution-parameters-in-templates.
  5. Select the Contents tab to view or edit the template.
    A template can contain the contents of multiple scripts. Each script has a unique Device Type and OS version. This enables you to organize common scripts across multiple vendors as a single template. For more information, see Understanding-template-formatting.

    AddTemplateContents.png 
  6. To modify the list of scripts, perform one of the following actions:
    • To add a script, select the script, and click Add.
    • To edit a script, select the script, and click Edit.
  7. Enter the following information, as needed:
    • Vendor and Device Type: Select the vendor and device type compatible with this template.
    • Minimum OS Version: Enter the minimal OS version for which this Template is compatible. Enter * to specify any major, minor, or build.
    • Maximum OS Version: Enter the maximum OS version for which this Template is compatible. Enter * to specify any major, minor, or build.
    • Injection Template: Select this check box if you want to inject the Deploy to Active action with device type command elements, such as interaction  httpinteraction  condition , or loops and modify the device configuration by using APIs. For more information about injection templates, see Changing device configurations.
    • Contents: Enter the configuration commands that are to be sent to a device during a Deploy to Stored or Deploy to Active operation. If you have copied an existing configuration, ensure that device specific configuration parameters (for example, hostname) are changed to match the target device.
    • Substitution Parameters: Insert substitution parameters, as described in Using-substitution-parameters-in-templates.
  8. When you are finished editing the script, click Enter and then click Save.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*