From 005db8177e7a1a37354324e07bb741037aea7cfc Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Thu, 8 Sep 2022 07:53:26 +0200 Subject: [PATCH] nmcli: Add xmit_hash_policy to bond options. (#5149) (#5253) * Add xmit_hash_policy to nmcli bond-options. * #5149 - Add changelog fragment. * Update plugins/modules/net_tools/nmcli.py Co-authored-by: Felix Fontein * Update changelogs/fragments/5149-nmcli-bond-option.yml Co-authored-by: Felix Fontein Co-authored-by: Ole Pannbacker Co-authored-by: Felix Fontein (cherry picked from commit b4f89b78dd43f75f434db3086d5302d104af070d) Co-authored-by: betuxy <72452886+betuxy@users.noreply.github.com> --- changelogs/fragments/5149-nmcli-bond-option.yml | 2 ++ plugins/modules/net_tools/nmcli.py | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 changelogs/fragments/5149-nmcli-bond-option.yml diff --git a/changelogs/fragments/5149-nmcli-bond-option.yml b/changelogs/fragments/5149-nmcli-bond-option.yml new file mode 100644 index 0000000000..2d168f8544 --- /dev/null +++ b/changelogs/fragments/5149-nmcli-bond-option.yml @@ -0,0 +1,2 @@ +minor_changes: + - nmcli - add bond option ``xmit_hash_policy`` to bond options (https://github.com/ansible-collections/community.general/issues/5148). diff --git a/plugins/modules/net_tools/nmcli.py b/plugins/modules/net_tools/nmcli.py index da7796894a..30cedee819 100644 --- a/plugins/modules/net_tools/nmcli.py +++ b/plugins/modules/net_tools/nmcli.py @@ -319,6 +319,11 @@ options: description: - This is only used with bond - updelay. type: int + xmit_hash_policy: + description: + - This is only used with bond - xmit_hash_policy type. + type: str + version_added: 5.6.0 arp_interval: description: - This is only used with bond - ARP interval. @@ -1440,6 +1445,7 @@ class Nmcli(object): self.primary = module.params['primary'] self.downdelay = module.params['downdelay'] self.updelay = module.params['updelay'] + self.xmit_hash_policy = module.params['xmit_hash_policy'] self.arp_interval = module.params['arp_interval'] self.arp_ip_target = module.params['arp_ip_target'] self.slavepriority = module.params['slavepriority'] @@ -1580,6 +1586,7 @@ class Nmcli(object): 'mode': self.mode, 'primary': self.primary, 'updelay': self.updelay, + 'xmit_hash_policy': self.xmit_hash_policy, }) elif self.type == 'bond-slave': options.update({ @@ -2227,6 +2234,7 @@ def main(): miimon=dict(type='int'), downdelay=dict(type='int'), updelay=dict(type='int'), + xmit_hash_policy=dict(type='str'), arp_interval=dict(type='int'), arp_ip_target=dict(type='str'), primary=dict(type='str'),