[Bug]: updating interface removes vlan-id's
Ansible NetBox Collection version
v3.20.0
Ansible version
ansible [core 2.17.8]
config file = /home/alfred@eidsiva/ansible/ansible-playbook-poc/ansible.cfg
configured module search path = ['/home/alfred@eidsiva/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/alfred@eidsiva/ansible/venv/lib/python3.10/site-packages/ansible
ansible collection location = /home/alfred@eidsiva/.ansible/collections:/usr/share/ansible/collections
executable location = /home/alfred@eidsiva/ansible/venv/bin/ansible
python version = 3.10.12 (main, Jan 17 2025, 14:35:34) [GCC 11.4.0] (/home/[email protected]/ansible/venv/bin/python)
jinja version = 3.1.5
libyaml = True
NetBox version
4.2.2
Python version
3.10
Steps to Reproduce
this task:
delegate_to: localhost netbox.netbox.netbox_device_interface: netbox_url: "{{ _netboxurl }}" netbox_token: "{{ _netboxtoken }}" validate_certs: false data: device: "{{ inventory_hostname }}" description: "{{ _description }}" enabled: "{{ _isenabled }}" name: "{{ _name }}" type: "virtual" parent_interface: "{{ interface_idx.name }}" mtu: "{{ _mtu }}" custom_fields: junos_family_inet_rpf_check: "{{ _family_inet_rpf_check }}" junos_interface_encapsulation_type: "{{ _encapsulation }}" state: present loop: "{{ interface_idx.unit }}" loop_control: loop_var: subinterface_idx
results in task output:
changed: { "ansible_loop_var": "subinterface_idx", "changed": true, "diff": { "after": { "custom_fields": { "junos_family_inet_rpf_check": false, "junos_interface_encapsulation_type": "" }, "description": "", "mtu": 9192 }, "before": { "custom_fields": { "junos_family_inet_rpf_check": false }, "description": """", "mtu": 65535 } },
but in reality, as collected from netbox changelog, this is changed:
Difference:
before: { "custom_fields": { ... "junos_family_inet_rpf_check": false, "junos_interface_encapsulation_type": null, ... }, "description": """", "mtu": 65535, "tagged_vlans": [ 19843 ] }
after: { "custom_fields": { ... "junos_family_inet_rpf_check": false, "junos_interface_encapsulation_type": "", ... }, "description": "", "mtu": 9192, "tagged_vlans": [] }
Expected Behavior
using netbox.netbox.netbox_device_interface to update the mentioned dict should not remove vlan tagged in tagged_vlans
Observed Behavior
using netbox.netbox.netbox_device_interface to update the mentioned dict, removes any vlan tagged at the same interface