cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1556
Views
0
Helpful
1
Replies

Prime template - Change config IF it exists

Josh Morris
Level 3
Level 3

I have a template that will make an addition to all GigabitEthernet interfaces on a switch. What I need though, is how can I change a line of config under an interface ONLY if it exists?

 

ONLY if it exists, I want to change 'authentication timer reauthenticate 7200' to 'authentication timer reauthenticate server'.

 

I'm thinking nested if statements, but I'm not sure what to put in the second if statement. I dont know how to write the syntax for the logic "if 'authentication timer reauthenticate 7200' exists, then change to 'authentication timer reauthenticate server'.

 

#foreach( $interfaceName in $interfaceNameList )
#if( $interfaceName.startsWith("GigabitEthernet") )
interface $interfaceName
#if( ???????? )
authentication timer reauthenticate server
#end
#end

1 Reply 1

iportuga
Cisco Employee
Cisco Employee

As this interface configuration is not modeled into database and CLI template can not use command outputs, you need to use Compliance Audit job feature to achieve the expected result.