[PR #6105/81b16a88 backport][stable-5] nmcli: fixed idempotency issue when config bridge connection (#6242)
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>
pull/6254/head
parent
40e0379112
commit
3176c08b5b
|
@ -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).
|
|
@ -1608,6 +1608,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,
|
||||
|
|
Loading…
Reference in New Issue