diff --git a/changelogs/fragments/1882-fix-nmcli-ensure-slave-type-for-bond-slave.yml b/changelogs/fragments/1882-fix-nmcli-ensure-slave-type-for-bond-slave.yml new file mode 100644 index 0000000000..47569b6a24 --- /dev/null +++ b/changelogs/fragments/1882-fix-nmcli-ensure-slave-type-for-bond-slave.yml @@ -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). diff --git a/plugins/modules/net_tools/nmcli.py b/plugins/modules/net_tools/nmcli.py index d469cbf1c2..2967996f3c 100644 --- a/plugins/modules/net_tools/nmcli.py +++ b/plugins/modules/net_tools/nmcli.py @@ -737,6 +737,10 @@ class Nmcli(object): 'primary': self.primary, 'updelay': self.updelay, }) + elif self.type == 'bond-slave': + options.update({ + 'connection.slave-type': 'bond', + }) elif self.type == 'bridge': options.update({ 'bridge.ageing-time': self.ageingtime,