( gazsiazasz | 2023. 06. 15., cs – 16:56 )

- hosts: localhost
  vars:
    interfaces:
      core-access: ['eth1', 'eth2', 'eth3']
      wlan: ['eth4', 'eth5']
      access: ['eth6']
    global_vlan_list:
      1: { type: ["core-access", "access", "wlan"] }
      2: { type: [] }
      3: { type: ["core-access", "access"] }
  tasks:
  - name: Create/update vlan
    debug:
      msg: "interface bridge vlan add tagged={{ item.value.type | map('extract', interfaces) | flatten | join(',') }}"
    with_dict: "{{ global_vlan_list }}"
    when: item.value.type | map('extract', interfaces) | flatten