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
------------------------------