From f77aa51ab8853442a968d30881d5a9c9afcbde5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Sat, 17 Apr 2021 04:33:40 -0400 Subject: [PATCH] nmcli: do not set IP configuration bond slaves (#2223) The master interface holds the IP configuration. If we try to update the IP configuration of the slaves, NetworkManager raises an error. --- changelogs/fragments/2223_nmcli_no_IP_config_on_slave.yaml | 3 +++ plugins/modules/net_tools/nmcli.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/2223_nmcli_no_IP_config_on_slave.yaml diff --git a/changelogs/fragments/2223_nmcli_no_IP_config_on_slave.yaml b/changelogs/fragments/2223_nmcli_no_IP_config_on_slave.yaml new file mode 100644 index 0000000000..4d98b62922 --- /dev/null +++ b/changelogs/fragments/2223_nmcli_no_IP_config_on_slave.yaml @@ -0,0 +1,3 @@ +--- +minor_changes: +- "nmcli - do not set IP configuration on slave connection (https://github.com/ansible-collections/community.general/pull/2223)." diff --git a/plugins/modules/net_tools/nmcli.py b/plugins/modules/net_tools/nmcli.py index 2967996f3c..d5b329fe03 100644 --- a/plugins/modules/net_tools/nmcli.py +++ b/plugins/modules/net_tools/nmcli.py @@ -695,7 +695,7 @@ class Nmcli(object): } # IP address options. - if self.ip_conn_type: + if self.ip_conn_type and not self.master: options.update({ 'ipv4.addresses': self.ip4, 'ipv4.dhcp-client-id': self.dhcp_client_id,