Please excuse the delay in getting back to this. Here are some tips regarding variables in Aruba Central:
If a template has a certain variable in the middle of the configuration template, all devices associated to the template need to have that variable, otherwise the configuration would error out.
However, you may want to use the same template for diferent devices, and not all devices may need all variables. When this is the case, you can use %if%, %else% %if_else% to create scripts. I've added a few examples below.
Then... What happens if you have more variables than the template is really "consuming"? That would be perfectly fine, Central would just carry those as "dead weight" associated to the device, and they would remain there in case the device is moved to a template that does consume them.
CLI Scripts
A CLI script is anything that use 'If-else-endif' syntax. Syntax could be as simple as only 'if-endif' structure to as complex as 'Nested if' structure. '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%