Cloud Managed Networks

 View Only
  • 1.  Aruba Central, some if statements ignored, others not

    Posted Jan 07, 2022 09:14 AM
    Edited by TV70 Jan 07, 2022 09:19 AM

    Hi,

    I have a bit of a strange issue. For example a if statement within a vlan is not problem, they all work. For example like this:

    vlan 9
       name "JFH_WIFI_GUEST"
       tagged %_uplink_%
       %if _AcessPoint_%
       tagged %_AcessPoint_%
       %endif%
       no ip address
       exit



    However this is just ignored (yes port is assigned in variables) with no errors

    %if _IOT_devices_%
    vlan 8
    	name "IOT"
    	tagged %_uplink_%
    	untagged %_IOT_devices_%
    	no ip address
    	exit
    %endif%



    And this is working:

    %if _workstations_%
    vlan 10
       name "JFH_Workstations"
       tagged %_uplink_%
       %if _workstations_%
       untagged %_workstations_%
       %endif%
       %if _AcessPoint_%
       untagged %_AcessPoint_%
       %endif%
       no ip address
       exit
    %endif%



    But this is also just ignored

    %if _ESX_host_%
    vlan 15
        name servers
    	tagged %_uplink_%,%_ESX_host_%
    	no ip address
        exit
    vlan 18
    	name "DC LAN"
    	tagged %_uplink_%,%_ESX_host_%
    	no ip address
        exit
    vlan 35
    	name "Mgmt Server"
    	tagged %_uplink_%,%_ESX_host_%
    	ip address dhcp-bootp
    	exit
    %endif%



    I get no template errors, and the config is pushes without them. If i move the if/endif to within the vlans it works just fine, but then i get lots of empty vlans on switches that dont need them. whats going on here?

    Here is the full template im testing with now. All is working well except this weird issue of ignoring the if statements.

    %_sys_template_header%
    hostname "%_sys_hostname%"
    %if _IS_STACK=1%
        %_sys_stack_command%  
    %endif%
    %if _IS_STACK=0%
        %_sys_module_command% 
    %endif%
    no cwmp enable
    include-credentials
    password manager user-name "##########" sha1 "############################"
    timesync sntp
    sntp unicast
    sntp server priority 1 #########
    sntp server priority 2 #########
    time daylight-time-rule %_DST_ZONE%
    time timezone %TIME_ZONE%
    interface %_uplink_%
        dhcp-snooping trust
        arp-protect trust
        name UPLINK
        exit
    snmp-server community ############ restricted
    snmpv3 engineid "%_sys_snmpv3_engineid%"
    vlan 1
       name "DEFAULT_VLAN"
       untagged %_sys_vlan_1_untag_command%
    %if _sys_use_dhcp=1%
       ip address dhcp-bootp
    %endif%
    %if _sys_use_dhcp=0%
       ip address %_sys_ip_address% %_sys_netmask%
    %endif%
       exit
    %if _IOT_devices_%
    vlan 8
    	name "IOT"
    	tagged %_uplink_%
    	untagged %_IOT_devices_%
    	no ip address
    	exit
    %endif%
    vlan 9
       name "###_WIFI_GUEST"
       tagged %_uplink_%
       %if _AcessPoint_%
       tagged %_AcessPoint_%
       %endif%
       no ip address
       exit
    %if _workstations_%
    vlan 10
       name "###_Workstations"
       tagged %_uplink_%
       %if _workstations_%
       untagged %_workstations_%
       %endif%
       %if _AcessPoint_%
       untagged %_AcessPoint_%
       %endif%
       no ip address
       exit
    %endif%
    %if _ESX_host_%
    vlan 15
        name servers
    	tagged %_uplink_%,%_ESX_host_%
    	no ip address
        exit
    vlan 18
    	name "DC LAN"
    	tagged %_uplink_%,%_ESX_host_%
    	no ip address
        exit
    vlan 35
    	name "Mgmt Server"
    	tagged %_uplink_%,%_ESX_host_%
    	ip address dhcp-bootp
    	exit
    %endif%
    %if _workstations_%
    vlan 36
       name "Mgmt Access"
       tagged %_uplink_%
       %if _AcessPoint_%
       tagged %_AcessPoint_%
       %endif%
       ip address dhcp-bootp
       no ip address
       exit
    %endif%
    dhcp-snooping vlan 10
    dhcp-snooping
    no dhcp-snooping option 82
    arp-protect vlan 10
    arp-protect
    spanning-tree
    spanning-tree priority %_stp_prio%
    %if _workstations_%
    spanning-tree %_workstations_% admin-edge
    no spanning-tree %_uplink_% auto-edge
    %endif%



    ------------------------------
    Tore Valberg
    ------------------------------



  • 2.  RE: Aruba Central, some if statements ignored, others not

    Posted Jan 07, 2022 09:46 AM

    I think i have partly figured it out. Seems like in some cases the variables are not applied when i edit it in batch. Multiple entries (Yes Modified =Y) some times they are ignored. I went into each switch indiviually to add the variables by grabbing the CSV from switch context instead of group context. But its weird:

    - IF i download the variables file from the TG, i can see the variables are set, but ignored in config,.
    -IF i download the variables file from switch context, the variables that was present on the same switch in the main file was simply missing. Had to add the column and re-upload.

    Ive seen this before a few times on my test switches that has ran other templates.

    "Never before seen" switches seem to pick up all the variables.



    ------------------------------
    Tore Valberg
    ------------------------------



  • 3.  RE: Aruba Central, some if statements ignored, others not

    Posted Jan 07, 2022 11:49 AM
    Interesting ... If the variables are showing in the switch template group but not in the device context, I would suggest opening a case with TAC to investigate. 

    Is this by chance a switch stack that you're working with?

    ------------------------------
    Any opinions expressed here are solely my own and not necessarily that of Hewlett Packard Enterprise or Aruba Networks.
    ------------------------------