Cloud Managed Networks

last person joined: 2 days ago 

Forum to discuss all things related to HPE Aruba Networking Central and UXI Network Management, including deployment of managed networks, configuration, best practices, APIs, Cloud Guest, AIOps, Presence Analytics, and other included Applications
Expand all | Collapse all

Problem using empty variables with configuration templates switches in Aruba Central

This thread has been viewed 5 times
  • 1.  Problem using empty variables with configuration templates switches in Aruba Central

    Posted Oct 01, 2018 07:10 AM

    Hello,

     

    I have the following issue.

     

    I want to use one configuration template for all my switches. The problem is when i use vlan variables and a vlan is not present on a switch and i do not configure the vlan variable or keep it empty i get a Template error. I says that the variable is not being used. I now use different config templates for every switch as a workaround this problem. But there should be a sollution for this.

     

    Anybody got any tips?



  • 2.  RE: Problem using empty variables with configuration templates switches in Aruba Central

    EMPLOYEE
    Posted Nov 08, 2018 05:14 PM

    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%

     

     

     

     



  • 3.  RE: Problem using empty variables with configuration templates switches in Aruba Central

    Posted Mar 02, 2020 03:03 PM

    Hello,

     

    We set up a stack  of 2930M in Aruba Central with TG, after use a conditionals for accomplish our sh run, is possible to use loops like "for, while"? 

     

    I think, it would let us a easier and cleaner template.

     

    Regards,

     

    Lluís P.