Closed 0xUnicorn closed 2 months ago
I found two problems in your data while trying to reproduce your issue. Could you please try and
tagged
key, so change tagged: "bridge, sfp-sfpplus1"
to tagged: "bridge,sfp-sfpplus1"
vlan-ids
an int, so change vlan-ids: "100"
to vlan-ids: 100
I hope that helps. I think the vlan-ids
field is actually the problem here.
Thanks a lot, it seems like it resolves the issue. Looking at the debug with -vvvv
the .id in new_data
and old_data
is the same now.
I'll need to setup an OOB port on my router before deploying the config with remove absent entries. So I'll give an update next week.
This worked perfectly. Thanks @derdeagle
That's good news, I am glad I could help.
SUMMARY
The implementation of
interface bridge vlan
for some reason changes the.id
on every execution. This causes theapi_modify
module to remove all of the existiing bridge vlans and creating new ones.ISSUE TYPE
COMPONENT NAME
api_modify
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Linux REDACTED 5.10.0-28-amd64 #1 SMP Debian 5.10.209-2 (2024-01-31) x86_64 GNU/Linux Debian GNU/Linux 11 (bullseye)
STEPS TO REPRODUCE
EXPECTED RESULTS
I would expect this task to be idempotent, and only remove rules that is an
absent_entry
.new_data:
ACTUAL RESULTS
When applying the
handle_absent_entries
theapi_modify
module removes all existingbridge vlans
because it can't match the new data with the old data because of a change in the.id
.Looking at everything else i'm using, they all keep the same
.id
value: