gekmihesg / ansible-openwrt

Manage OpenWRT and derivatives with Ansible but without Python
GNU General Public License v3.0
355 stars 63 forks source link

can't create a new device of type 8021q (vlan) #73

Open apolovov opened 2 weeks ago

apolovov commented 2 weeks ago

Trying to add a vlan device:

  - name: configure vlan 100
    uci:
      command: section
      config: network
      type: device
      find_by:
        name: wan.100
      values:
        name: wan.100
        type: 8021q
        ifname: wan
        vid: '100'

But on the owrt i see unconfigured network with only a name:

config device
    option name 'wan.100'

OpenWRT version: 23.05.4 ansible version: 2.17.3

apolovov commented 2 weeks ago

Found a workaround:

  - name: create device wan_100
    uci:
      command: add
      config: network
      type: device
      section: wan_100
  - name: configure wan_100 device
    uci:
      command: set
      config: network
      type: device
      section: wan_100
      value:
        name: wan.100
        type: 8021q
        ifname: wan
        vid: '100'