Lab Guide 1 - Multi-vendor
Configlets
Configlets are small configuration segments that are used to apply device settings that fall outside the Apstra Reference Design parameters. Examples of common Configlet usage are items like syslog, SNMP, TACACS/RADIUS, management interface ACLs, control plane policing and NTP settings. The NTP example is the one we will use to show you the process of working with Configlets.
In addition, we are going to use another mechanism called Property Sets. These increase flexibility by allowing us to use variables in a Configlet. This is quite handy if we would like to use a common Configlet structure for our devices, but not all devices require the same values. This exercise calls for us to add the Junos style and variables to an existing NTP Configlet. Property Sets will supply the IP address for the server and identify the VRF to apply the configurations into.
Always remember that Configlets are a powerful way to apply configuration that falls outside of the Apstra Reference Designs. In other words, do not use Configlets for features that Apstra manages, itself. Doing so can interfere with the proper operation of the solution. It is critical that the configurations applied in Configlets are thoroughly verified before applying them in a Blueprint. Otherwise, malformed Configlets will cause errors and interfere with deployment.
This exercise is intended to introduce fundamental concepts for configlets. Please visit this TechPost article for deeper dive into the power of Apstra Configlets;
Edit NTP Configlet
Let’s add an operating system (Config Style) to an existing configlet.
-
Navigate to Design > Configlets and click US-EAST-NTP to see its details.
-
Click the Edit button (top-right), then at the bottom of the dialog, click Add a Style.
-
For Config Style select SONIC and for Section select System.
-
For Template Text copy and paste the following text.
config ntp add {{ntp_server}}
-
For Negation Template Text copy and paste the following text.
config ntp del {{ntp_server}}
-
Click Update (bottom-right) to add Junos to the existing configlet.
Apply NTP Configlet
Now we need to apply the NTP configlet to the blueprint so the NTP service is enabled for network devices in our topology.
-
This configlet uses multiple variables which are set using Property Sets, so the first thing we need to do is import it into the blueprint. From the blueprint, navigate to Staged > Catalog > Property Sets and click Import Property Set.
-
Select US-EAST-NTP from the drop-down list, then click Import Property Set. The property set is added to the property set blueprint catalog. Repeat this task with the property set MGMT VRF.
-
Navigate to the Configlets tab under Catalog and click Import Configlet.
-
Select US-EAST-NTP from the configlet drop-down list, then select the checkboxes for both Spine and Leaf roles. This is where you select the devices or roles to apply this configlet.
-
Click Import Configlet. The configlet is added to the configlet blueprint catalog.
-
Click Uncommitted to see in the Logical Diff tab that the property set and configlet were added.
-
Click Commit. enter the revision description "Add Cumulus to US-EAST-NTP configlet", then click Commit to commit the changes to the Active blueprint and deploy the configlet.