How to rename VLANs with e.g. arista.eos.eos_vlan, cisco.nxos.nxos_vlans, etc.?

I’ve figured out how to rename VLANs in aoscx, but I’m at a loss for how to do this in Arista EOS or Cisco IOS/IOSX/NXOS or most other platforms.

I have VLANs in the field that I want to rename, without altering anything else about the VLAN.
Right now, I’m pulling in a giant VLANS hash (dict?) with { vlan_id , name } in it, and passing it to the repsective platform’s _vlans module’s config: bit, in “merged” mode.
Merged mode does not appear to update VLAN names on any of the platforms, although it will create the VLAN with the correct name if it’s missing.

With aoscx_vlan, there’s no config object, I have to iterate anyway with state: update, and that seems to work.

I do NOT want to use state: replaced because that alters other VLAN properties, such as whether it’s enabled or not.

Anyone have a suggestion?

Hi. I think the only other option is to use something like the cisco.ios.ios_config module.

Example from role:

$ cat tasks/main.yml
---
- name: Ensure vlans.
  cisco.ios.ios_config:
    src: vlans.j2
    save_when: modified

$ cat templates/vlans.j2
{% for vlan_item in vlan_config %}
vlan {{ vlan_item['vlan_id'] }}
 name {{ vlan_item['name'] }}
{% endfor %}

$ cat defaults/main.yml
---
vlan_config:
  - name: Example1
    vlan_id: 10
  - name: Example2
    vlan_id: 20

This will create missing vlans or update the name if the vlan already exists. All other vlan parameters will remain untouched.