diff options
Diffstat (limited to 'inventory')
-rw-r--r-- | inventory/group_vars/chaos-at-home-switches/vars.yml | 2 | ||||
-rw-r--r-- | inventory/group_vars/vmhost-ch-prometheus/vars.yml | 2 | ||||
-rw-r--r-- | inventory/host_vars/ch-sw1.yml | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/inventory/group_vars/chaos-at-home-switches/vars.yml b/inventory/group_vars/chaos-at-home-switches/vars.yml index fb72c9b1..2b5bc625 100644 --- a/inventory/group_vars/chaos-at-home-switches/vars.yml +++ b/inventory/group_vars/chaos-at-home-switches/vars.yml @@ -5,8 +5,10 @@ switch_mgmt_interface: "Gi1/0/28" switch_vlans: "{{ switch_vlans_yaml | from_yaml }}" switch_vlans_yaml: | {% for zone_name in network_zones.keys() %} + {% if 'vlan' in network_zones[zone_name] %} - name: "{{ zone_name }}" id: "{{ network_zones[zone_name].vlan }}" + {% endif %} {% endfor %} switch_interfaces: "{{ switch_interfaces_yaml | from_yaml }}" diff --git a/inventory/group_vars/vmhost-ch-prometheus/vars.yml b/inventory/group_vars/vmhost-ch-prometheus/vars.yml index 888c0bcf..ac5e3b6e 100644 --- a/inventory/group_vars/vmhost-ch-prometheus/vars.yml +++ b/inventory/group_vars/vmhost-ch-prometheus/vars.yml @@ -1,6 +1,6 @@ --- __vmhost_bridge_interface_zones__: - bond0: "{{ network_zones | list | difference(['lan']) }}" + bond0: "{{ network_zones | dict2items | selectattr('value.vlan', 'defined') | map(attribute='key') | difference(['lan']) }}" __vmhost_bridge_interface_zones_yaml__: | {% for interface in (__vmhost_bridge_interface_zones__.keys() | sort) %} diff --git a/inventory/host_vars/ch-sw1.yml b/inventory/host_vars/ch-sw1.yml index ad7b6372..cf77edbf 100644 --- a/inventory/host_vars/ch-sw1.yml +++ b/inventory/host_vars/ch-sw1.yml @@ -22,7 +22,7 @@ switch_interfaces_yaml: | description: "prometheus" switchport_mode: general tagged_only: yes - allowed_vlans_tagged: {{ network_zones | list | difference(['lan']) | map('extract', network_zones) | map(attribute='vlan') | list }} + allowed_vlans_tagged: {{ network_zones | list | difference(['lan']) | map('extract', network_zones) | selectattr('vlan', 'defined') | map(attribute='vlan') | list }} - spec: range Gi1/0/7-14 vlan: {{ network_zones.lan.vlan }} |