diff --git a/changelogs/fragments/2224_nmcli_allow_MAC_overwrite.yaml b/changelogs/fragments/2224_nmcli_allow_MAC_overwrite.yaml new file mode 100644 index 0000000000..98852463d8 --- /dev/null +++ b/changelogs/fragments/2224_nmcli_allow_MAC_overwrite.yaml @@ -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)." diff --git a/plugins/modules/net_tools/nmcli.py b/plugins/modules/net_tools/nmcli.py index 2b402a2230..4ae5a1dac9 100644 --- a/plugins/modules/net_tools/nmcli.py +++ b/plugins/modules/net_tools/nmcli.py @@ -210,7 +210,7 @@ options: default: 300 mac: 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. type: str slavepriority: @@ -742,7 +742,7 @@ class Nmcli(object): }) # Layer 2 options. - if self.mac_conn_type: + if self.mac: options.update({self.mac_setting: self.mac}) if self.mtu_conn_type: @@ -842,10 +842,6 @@ class Nmcli(object): 'wifi' ) - @property - def mac_conn_type(self): - return self.type == 'bridge' - @property def mac_setting(self): if self.type == 'bridge':