Open
Description
SUMMARY
It's only possible to use the interface bridge vlan
path with the api_modify
module if the vlan does not already exist.
It errors out if the vlan exists, both when attempting to modify the vlan but also when the config matches the existing vlan and it should not be attempting to modify it.
ISSUE TYPE
- Bug Report
COMPONENT NAME
api_modify
interface bridge vlan
ANSIBLE VERSION
ansible [core 2.17.4]
config file = /home/g/.ansible.cfg
configured module search path = ['/home/g/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.12/site-packages/ansible
ansible collection location = /home/g/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.12.6 (main, Sep 8 2024, 13:18:56) [GCC 14.2.1 20240805] (/usr/bin/python)
jinja version = 3.1.4
libyaml = True
COLLECTION VERSION
# /usr/lib/python3.12/site-packages/ansible_collections
Collection Version
------------------ -------
community.routeros 2.19.0
CONFIGURATION
ANSIBLE_FORCE_COLOR(env: ANSIBLE_FORCE_COLOR) = True
ANSIBLE_PIPELINING(/home/g/.ansible.cfg) = True
CONFIG_FILE() = /home/g/.ansible.cfg
EDITOR(env: EDITOR) = vim
PAGER(env: PAGER) = less
OS / ENVIRONMENT
RouterOS 7.16.1
STEPS TO REPRODUCE
---
- community.routeros.api_modify:
path: interface bridge vlan
data:
- vlan-ids: 2
comment: test
bridge: bridge
tagged: ether2
EXPECTED RESULTS
The vlan should be modified if the data
is different than the configuration on the device. If it's the same then it should not change the interface and give ok status.
ACTUAL RESULTS
"msg": "Error while creating entry for bridge=\"bridge\", vlan-ids=\"2\": failure: vlan already added"