Lab Guide 1 - Juniper
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.
Edit NTP Configlet
Our exercise calls for us to edit a Configlet and add an additional Config Style for Junos.
-
Navigate to Design > Configlets, where the global Configlets reside.
-
Click the US-EAST-NTP that is already present and view its details.
-
Click the Edit button (top-right), then at the bottom of the dialog, click Add a Style.
-
In the Edit Configlet view, set Config Style to Junos. Under Top-level, select Hierarchical. Copy-and-paste the Template Text below the image into the Configlet, as shown. Be sure to be accurate in this step, so we don’t get errors later. Once complete, press the Update button in the lower right to save your work.
Template Text
system { ntp { server {{ntp_server}} routing-instance {{junos_mgmt_vrf}}; } }
Import the Configlet and Property Sets
The Configlet we edited resides in the global Design area of the Apstra server. To use it, we need to import the NTP Configlet into a Blueprint where it can be applied to our Junos devices. We also need to bring in two Property Sets containing values for the variables. To do this, we go into the Blueprint and move to the Catalog area.
-
Navigate to the Staged > Catalog > Configlets area and click Import Configlet.
-
In the dialog box, select US-EAST-NTP that we edited just earlier. You can see from this view that this Configlet has the Junos template text that it did not have, previously.
-
Now, scroll down a bit to specify the device roles to which this Configlet will be applied. Select spine and leaf. Click Import Configlet.
-
The Blueprint must also contain the Property Sets that align with the Configlet’s variables. This Configlet expects two values to be supplied in this manner. There are two existing Property Sets in the global Design > Property Sets area that we need. Each one of these contains values we need. One is for the NTP server IP address and the other is for the VRF values. Navigate inside the Blueprint to Staged > Catalog > Property Sets and click Import Property Set.
-
Select US-EAST-NTP from the drop-down list, then click Import Property Set. This copies the Property Set into the Blueprint catalog.
-
Repeat these same steps for the second property set, MGMT VRF.
-
Great job! Now we can review our work and commit it to the Blueprint. Select the Uncommitted tab at the top center. It presently has a yellow icon. Note the items present in the list.
-
Click Commit. Enter the revision description "Added Junos to US-EAST-NTP configlet.", then click Commit again to commit for the changes to be added to the devices in the Blueprint. If you would like to view the Configlet contents in the device configurations, view the Rendered Configuration for each device.