1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

[PR #6105/81b16a88 backport][stable-6] nmcli: fixed idempotency issue when config bridge connection (#6243)

nmcli: fixed idempotency issue when config bridge connection (#6105)

* nmcli: fixed idempotency issue when config bridge connection

* Update changelog fragment.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 81b16a88ee)

Co-authored-by: Sam Potekhin <heaveaxy@gmail.com>
This commit is contained in:
patchback[bot] 2023-03-26 09:48:29 +02:00 committed by GitHub
parent 4f78e7979e
commit 3432be3a2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- nmcli - fixed idempotency issue for bridge connections. Module forced default value of ``bridge.priority`` to nmcli if not set; if ``bridge.stp`` is disabled nmcli ignores it and keep default (https://github.com/ansible-collections/community.general/issues/3216, https://github.com/ansible-collections/community.general/issues/4683).

View file

@ -1629,6 +1629,10 @@ class Nmcli(object):
'bridge.priority': self.priority,
'bridge.stp': self.stp,
})
# priority make sense when stp enabed, otherwise nmcli keeps bridge-priority to 32768 regrdless of input.
# force ignoring to save idempotency
if self.stp:
options.update({'bridge.priority': self.priority})
elif self.type == 'team':
options.update({
'team.runner': self.runner,