cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1173
Views
0
Helpful
3
Replies

LMS4.1 Template Center Question

STEFFEN NEUSER
Level 4
Level 4

Hello,

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">
    <clicommand>
default interface ${current_port?}
switchport access vlan ${access-vlan-id}
switchport mode access
switchport voice vlan ${voice-vlan-id}
    </clicommand>
</cli>

Steffen

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

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

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

defaultdefault

% Incomplete command.

Sw01234(config)#

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

switchport access vlan 20Sw01234(config-if)#

switchport mode accessSw01234(config-if)#

switchport voice vlan 152Sw01234(config-if)#

Sw01234(config-if)#

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!.