Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Create Configlet

Create configlets in the Design catalog in preparation for importing them into blueprints.

To create a configlet in the GUI:

  1. From the left navigation menu, navigate to Design > Configlets and click Create Configlet.
    The Create Configlet dialog opens.
  2. If you've created a configlet JSON payload, click Import Configlet and select the file to import. Otherwise, continue to the next step.

    Either click Choose File and navigate to the image on your computer; or drag and drop the image from your computer into the dialog window, click Import Configlet, then click Create.

    The configlet is created and you're returned to the Configlets table view.

  3. If you're not uploading a JSON file, then enter configlet details manually.

    Configlet parameters vary depending on the NOS type and the location where the configlet is to to take effect. For some references, see the configlet examples and the GitHub repo. You can also access a dictionary of variables (device model) that you can use when you create configlets, see the Device Configuration Lifecycle.

    Our example is for SONiC configuration that's added as a file at the end of rendering steps.

    1. Enter a unique configlet name (64 characters or fewer) in the Name field.
    2. Select the vendor NOS (Junos, NX-OS, EOS, SONiC) from the Config Style field.
    3. Select the section where you want to render the configlet. Available choices depend on the selected config style. (OSPF for external routers is no longer supported. While OSPF configlets still appear in the GUI, they should not be used.) Our example is in th FILE section, which renders after the reference design.
    4. In the Template Text and Negation Template Text fields (as applicable), enter CLI commands. For Interface-Level Set or Delete configlets, do not include set or delete in the text. Avoid using shortened versions of commands. Jinja syntax is highlighted with color coding to improve readability, especially for complex configlets with multiple property set variables or when Jinja control structures (such as loops and conditionals) are used. Jinja syntax is validated. If Jinja syntax is incorrect, a validation error is raised.
      CAUTION:

      Using a raw text editor (OSX TextEdit, Windows Notepad++) is critical. Hidden characters can cause unforeseen issues when the configlet is deployed.

      Note:

      Instead of hard-coding data into a configlet, you can refer to a property set (key-value pairs). For an example, see the Arista NTP example in the References section.

    5. If Negation Template Text is required, enter the CLI commands to remove the configuration.
    6. For File configlets, enter the filename in the Filename field.
  4. To add another generator, click Add a style and enter details. (Tip: Configlets can contain syntax for multiple vendors. Create one single-purpose configlet with a generator for each vendor NOS type to include its own syntax.)
  5. Click Create.
The configlet is created and you're returned to the Configlets table view.

When you’re ready to use the configlet in a blueprint, import it into the blueprint's catalog and define its scope (based on role, name, hostname, and/or system tags.