Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

LMS4.1 Template Center Question


Is it possible to access global variables (current device and current port) in the CLI commands and what are there names?

The customer wants to run the "default interface gi x/y/z" command before deploying customized commands, but it is not inside the interface context and need to be parametrisized, for example:

<cli name="edgeConfig">
default interface ${current_port?}
switchport access vlan ${access-vlan-id}
switchport mode access
switchport voice vlan ${voice-vlan-id}


Everyone's tags (3)
Cisco Employee

LMS4.1 Template Center Question

The ${interface} variable should hold the current interface.

New Member

LMS4.1 Template Center Question

Hi Jo,

Thx for the variablename, but the 2nd part of problem with differnt command level in one template is left:

default interface ${current_port?}

belongs at global level and the remaining statements at interface level.

Please see, why it is not working below. Have you got an idea to get this working?

Results for Device Sw01234

Device Deployed

Pre Device Execution Message:

Post Device Execution Message:

Update Startup Not Attempted

Results of Deploy:

Message: Deploy command partially failed


% Incomplete command.


interface Gi2/0/43Sw01234(config-if)#

switchport access vlan 20Sw01234(config-if)#

switchport mode accessSw01234(config-if)#

switchport voice vlan 152Sw01234(config-if)#


Cisco Employee

LMS4.1 Template Center Question

Ah, yes.  I did something similar at CiscoLive!, but I used a device template.  Sadly, the default int thing did not work.  I ran into a bug (CSCua86328).  You cannot reuse the same variable within a template.

I have not tried this within an interface template, but I don't think it would work given that you'd have to reuse a variable.  The other alternative is to use a lot of "default" commands within the interface.  This is what I ended up doing at CiscoLive!.

CreatePlease login to create content