1
0
Fork 0
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:
Gonéri Le Bouder 2021-04-19 13:02:48 -04:00 committed by GitHub
parent 04bf8137fa
commit b10d707a8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View 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)."

View file

@ -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':