Port/VLAN Configuration (EOS) - Command Templates
  • 15 Mar 2023
  • Dark
    Light
  • PDF

Port/VLAN Configuration (EOS) - Command Templates

  • Dark
    Light
  • PDF

Article Summary

create_cmd_template_title

Command Templates allow users to apply CLI knowledge and skills as part of their automation strategy. Here we will build a simple template that will run the show interface command against the EOS device and confirm that the port is in an up/up state. Multiple steps in the Port Turn Up - EOS workflow are Command Templates, so this exercise will give you a better idea of how that workflow operates.

The use cases outlined within this section are intended to be completed on Itential's Trial infrastructure and lab. For more details about accessing this infrastructure and lab, please visit www.itential.com/get-started

Step 1

From the Itential Automation Platform dashboard, click Automation Studio in the left navigation panel.

Graphical user interface, website  Description automatically generated


Step 2

Click the + icon at the top of the left navigation panel.

Graphical user interface, website  Description automatically generated


Step 3

The Create window opens. Click the dropdown menu and select Command Template in the What would you like to create field.

Graphical user interface, application  Description automatically generated


Step 4

Name the template EOS Template - XX , where XX represents your initials, and click CREATE.

Step4_EOS_CommandTemplate(1)


Step 5

The Command Template window opens and we are ready to enter the first command. On the right-hand side of the Command #1 box you’ll find the rules section. Here the user can define the rule logic associated with the command they’ve entered in the left-hand box. We expect our command show interface Ethernet1 to return Ethernet1 is up so in this case, we will select contains in our rules dropdown and enter Ethernet is up in the text field next to the rule dropdown. 

In the Command #1 box, enter show interface Ethernet1.

Step5_EOS_CommandTemplate


Step 6

In the Rules box, enter Ethernet1 is up. Next, we will select a target device. In the device search box, enter EOS and press enter. Select the EOS option that appears in blue directly below to select our target device for this Command Template.

Step6_EOS_CommandTemplate


Step 7

We are ready to test. Click TEST ALL COMMANDS.


Step 8

The results appear at the bottom. Notice our template passed and there is a green check mark next to the rule.

Step8_EOS_CommandTemplate(1)

Command Templates with Variables

This first version of the template we built used a static value for the port. While this is great for testing a template as it is built, ideally we want the template to be more flexible when implemented as part of a workflow. To do this, we’ll introduce variables to our template.


Step 9

For Command #1 that we just created, we will modify the command slightly.  We will replace Ethernet1 with <!interface!>.  The <! !> denotes a new variable within a Command Template. In this case, we are variablizing the port name.

Step9_EOS_CommandTemplate(1)


Step 10

Type <!interface!> is up in the Rule field in the Rules section. What we have now accomplished is that a user can enter any port name when executing the Command Template and the Command Template will verify that the port is up.

Click the TEST ALL COMMANDS button.

Step10_EOS_CommandTemplate


Step 11

An Enter Values prompt displays. Type Ethernet1 in the interface field. Click the SUBMIT button.

Step11_EOS_CommandTemplate


Step 12

As expected, the Command Template passed.  The results of the command template can be seen directly below in the Test Results box. Review the results box. 

Step12_EOS_CommandTemplate







Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.