mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix: nmcli - Ensure slave-type for bond-slave (#1882)
* Fix: nmcli - Ensure slave-type for bond-slave
Hello 🙂
When using bond-slave type, by default command sent to nmcl is:
['/usr/bin/nmcli', 'con', 'add', 'type', 'bond-slave', 'con-name', 'enp129s0f0', 'connection.interface-name', 'enp129s0f0', 'connection.autoconnect', 'yes', 'connection.master', 'bond0']
Which is not enough, nmcli will complain that connection.slave-type is missing. This small fix solve this issue.
If this change is approved, I will add the changelog fragment.
* Fix: nmcli - Adding changelog fragment for 1882
* Update changelogs/fragments/1882-fix-nmcli-ensure-slave-type-for-bond-slave.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
ce5aea790d
commit
dec345b818
2 changed files with 6 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- nmcli - ensure the ``slave-type`` option is passed to ``nmcli`` for type ``bond-slave`` (https://github.com/ansible-collections/community.general/pull/1882).
|
|
@ -737,6 +737,10 @@ class Nmcli(object):
|
||||||
'primary': self.primary,
|
'primary': self.primary,
|
||||||
'updelay': self.updelay,
|
'updelay': self.updelay,
|
||||||
})
|
})
|
||||||
|
elif self.type == 'bond-slave':
|
||||||
|
options.update({
|
||||||
|
'connection.slave-type': 'bond',
|
||||||
|
})
|
||||||
elif self.type == 'bridge':
|
elif self.type == 'bridge':
|
||||||
options.update({
|
options.update({
|
||||||
'bridge.ageing-time': self.ageingtime,
|
'bridge.ageing-time': self.ageingtime,
|
||||||
|
|
Loading…
Reference in a new issue