Hi all,
Trying to create a configlet that will allow me push some config based on hostname and routing-instance name. So this is a 2 part configlet that I'm trying to get together.
Ex:
Hostname: NA-B-COMPANY-PE or NA-C-COMPANY-RI or NA-C-COMPANY-RR1 (I have all)
Routing-Instance: INTERNET
Basically what I need is to push config to a router if hostname contains "B" AND "INTERNET" routing-instance is present. If INTERNET is not present then it only has to push the first part of the configlet. Also if "B" is not present then it has to push all.
I defined 2 variable one for hostname and one for routing-instance which both point to their correspondant XPATH. I can get the name piece to work but not the routing-instance part.
So far I did the following:
#set ( $Hostname = $Hostname.get(0).split("-") )
#set ( $Instance = $Instance.get(0) )
#if ( $Hostname.get(2) == "B" )
groups {
LSP {
protocols {
mpls {
delete: no-propagate-ttl;
}
}
}
}
#if ($Instance.get(0) == "INTERNET" )
routing-instances {
INTERNET {
no-vrf-propagate-ttl;
}
}
#else
#end
#else
groups {
LSP {
protocols {
mpls {
delete: no-propagate-ttl;
}
}
}
}
routing-instances {
INTERNET {
no-vrf-propagate-ttl;
}
#end
I've also tried using a #foreach command to try to grab all the routing-instances names but still no luck. Any advise on this? Thanks!
#space#configlets#Automation#variables