Cloud Managed Networks

Reply
Highlighted
Occasional Contributor II

empty json variable when using config templates for switches in Aruba Central

Hello,

 

I have different switches using the same configuration template in Aruba Central. Some switches don't have untagged VLANS on their ports. But because i use variable for this untagged VLAN i get a template ERROR on the switches who don't use that untagged VLAN. 

 

"vlan.508.untagged": "" doesn't work. I get no value ERROR. Null doesn't work either. 

 

Anybody got experience with this. I think the only solution is to use different config templates for every switch. I'm not a json guru, so maybe you can do something else i don't know. 

Highlighted
Moderator

Re: empty json variable when using config templates for switches in Aruba Central

Central templates admit %if variable% type of constructs precisely for this use case. Here are some examples:

 

If-endif

%if condition1=true%
routing-profile 10.10.1.0 255.255.255.0 10.10.1.255
%endif%

If-else-endif

%if condition1=true%
routing-profile 10.40.0.0 255.255.255.0 10.40.0.255
%else%
routing-profile 10.20.1.0 255.255.255.0 10.20.1.255
%endif%

Nested if

%if condition1=true%
routing-profile 10.10.0.0 255.255.255.0 10.10.0.255
   %if condition2=true%
   routing-profile 10.30.1.0 255.255.255.0 10.30.1.255
   %else%
   routing-profile 10.50.1.0 255.255.255.0 10.50.1.255
   %endif%
%else%
routing-profile 10.20.0.0 255.255.255.0 10.20.0.255
   %if condition3=true%
   routing-profile 10.70.1.0 255.255.255.0 10.70.1.255
   %else%
   routing-profile 10.40.1.0 255.255.255.0 10.40.1.255
   %endif%
%endif%

 


Samuel Pérez
ACMP, ACCP, ACDX#100

---

If I answerd your question, please click on "Accept as Solution".
If you find this post useful, give me kudos for it ;)