mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
nmcli: manual overwrite MAC address for any devices (#2224)
* nmcli: manual overwrite MAC address for any devices Don't restrict the ability to manually set the MAC address to the bridge. NetworkManager is able to set a static MAC address to the vaste majority of the device types. * Update changelogs/fragments/2224_nmcli_allow_MAC_overwrite.yaml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
04bf8137fa
commit
b10d707a8b
2 changed files with 5 additions and 6 deletions
3
changelogs/fragments/2224_nmcli_allow_MAC_overwrite.yaml
Normal file
3
changelogs/fragments/2224_nmcli_allow_MAC_overwrite.yaml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
minor_changes:
|
||||||
|
- "nmcli - don't restrict the ability to manually set the MAC address to the bridge (https://github.com/ansible-collections/community.general/pull/2224)."
|
|
@ -210,7 +210,7 @@ options:
|
||||||
default: 300
|
default: 300
|
||||||
mac:
|
mac:
|
||||||
description:
|
description:
|
||||||
- This is only used with bridge - MAC address of the bridge.
|
- MAC address of the connection.
|
||||||
- Note this requires a recent kernel feature, originally introduced in 3.15 upstream kernel.
|
- Note this requires a recent kernel feature, originally introduced in 3.15 upstream kernel.
|
||||||
type: str
|
type: str
|
||||||
slavepriority:
|
slavepriority:
|
||||||
|
@ -742,7 +742,7 @@ class Nmcli(object):
|
||||||
})
|
})
|
||||||
|
|
||||||
# Layer 2 options.
|
# Layer 2 options.
|
||||||
if self.mac_conn_type:
|
if self.mac:
|
||||||
options.update({self.mac_setting: self.mac})
|
options.update({self.mac_setting: self.mac})
|
||||||
|
|
||||||
if self.mtu_conn_type:
|
if self.mtu_conn_type:
|
||||||
|
@ -842,10 +842,6 @@ class Nmcli(object):
|
||||||
'wifi'
|
'wifi'
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
|
||||||
def mac_conn_type(self):
|
|
||||||
return self.type == 'bridge'
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def mac_setting(self):
|
def mac_setting(self):
|
||||||
if self.type == 'bridge':
|
if self.type == 'bridge':
|
||||||
|
|
Loading…
Reference in a new issue