Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nmcli): support the fail_over_mac parameter #9571

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- Add the parameter fail_over_mac to the module nmcli
cnfrancis marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 10 additions & 0 deletions plugins/modules/nmcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@
- This is only used with bond - xmit_hash_policy type.
type: str
version_added: 5.6.0
fail_over_mac:
description:
- This is only used with bond - fail_over_mac.
type: int
cnfrancis marked this conversation as resolved.
Show resolved Hide resolved
arp_interval:
description:
- This is only used with bond - ARP interval.
Expand Down Expand Up @@ -1691,6 +1695,7 @@ def __init__(self, module):
self.downdelay = module.params['downdelay']
self.updelay = module.params['updelay']
self.xmit_hash_policy = module.params['xmit_hash_policy']
self.fail_over_mac = module.params['fail_over_mac']
self.arp_interval = module.params['arp_interval']
self.arp_ip_target = module.params['arp_ip_target']
self.slavepriority = module.params['slavepriority']
Expand Down Expand Up @@ -1839,6 +1844,7 @@ def connection_options(self, detect_change=False):
'primary': self.primary,
'updelay': self.updelay,
'xmit_hash_policy': self.xmit_hash_policy,
'fail_over_mac': self.fail_over_mac,
})
elif self.type == 'bond-slave':
if self.slave_type and self.slave_type != 'bond':
Expand Down Expand Up @@ -2286,6 +2292,9 @@ def connection_update(self, nmcli_command):
if key == 'xmit_hash_policy':
cmd.extend(['+bond.options', 'xmit_hash_policy=%s' % value])
continue
if key == 'fail_over_mac':
cmd.extend(['+bond.options', 'fail_over_mac=%s' % value])
continue
cmd.extend([key, value])

return self.execute_command(cmd)
Expand Down Expand Up @@ -2602,6 +2611,7 @@ def main():
downdelay=dict(type='int'),
updelay=dict(type='int'),
xmit_hash_policy=dict(type='str'),
fail_over_mac=dict(type='int'),
felixfontein marked this conversation as resolved.
Show resolved Hide resolved
arp_interval=dict(type='int'),
arp_ip_target=dict(type='str'),
primary=dict(type='str'),
Expand Down
1 change: 1 addition & 0 deletions tests/unit/plugins/modules/test_nmcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4397,6 +4397,7 @@ def test_bond_connection_unchanged(mocked_generic_connection_diff_check, capfd):
downdelay=dict(type='int'),
updelay=dict(type='int'),
xmit_hash_policy=dict(type='str'),
fail_over_mac=dict(type='int'),
arp_interval=dict(type='int'),
arp_ip_target=dict(type='str'),
primary=dict(type='str'),
Expand Down
Loading