From ed8049a220096f8eaaa2bbdee665d40d00adfd56 Mon Sep 17 00:00:00 2001 From: Jeffrey Cutter Date: Fri, 24 Mar 2023 02:55:58 -0400 Subject: [PATCH] nmcli: add new addr_gen_mode6 options (#5974) * nmcli: add new addr_gen_mode6 options * Add changelog fragment. * Update plugins/modules/nmcli.py Co-authored-by: Felix Fontein * Adjust documentation. --------- Co-authored-by: Felix Fontein --- .../fragments/5974-nmcli_add_new_addr_gen_mode6_options.yml | 2 ++ plugins/modules/nmcli.py | 5 +++-- tests/unit/plugins/modules/test_nmcli.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/5974-nmcli_add_new_addr_gen_mode6_options.yml diff --git a/changelogs/fragments/5974-nmcli_add_new_addr_gen_mode6_options.yml b/changelogs/fragments/5974-nmcli_add_new_addr_gen_mode6_options.yml new file mode 100644 index 0000000000..275ed8b584 --- /dev/null +++ b/changelogs/fragments/5974-nmcli_add_new_addr_gen_mode6_options.yml @@ -0,0 +1,2 @@ +minor_changes: + - nmcli - add ``default`` and ``default-or-eui64`` to the list of valid choices for ``addr_gen_mode6`` parameter (https://github.com/ansible-collections/community.general/pull/5974). diff --git a/plugins/modules/nmcli.py b/plugins/modules/nmcli.py index cc4c527608..b163b387a1 100644 --- a/plugins/modules/nmcli.py +++ b/plugins/modules/nmcli.py @@ -302,8 +302,9 @@ options: addr_gen_mode6: description: - Configure method for creating the address for use with IPv6 Stateless Address Autoconfiguration. + - C(default) and C(deafult-or-eui64) have been added in community.general 6.5.0. type: str - choices: [eui64, stable-privacy] + choices: [default, default-or-eui64, eui64, stable-privacy] version_added: 4.2.0 mtu: description: @@ -2264,7 +2265,7 @@ def main(): route_metric6=dict(type='int'), method6=dict(type='str', choices=['ignore', 'auto', 'dhcp', 'link-local', 'manual', 'shared', 'disabled']), ip_privacy6=dict(type='str', choices=['disabled', 'prefer-public-addr', 'prefer-temp-addr', 'unknown']), - addr_gen_mode6=dict(type='str', choices=['eui64', 'stable-privacy']), + addr_gen_mode6=dict(type='str', choices=['default', 'default-or-eui64', 'eui64', 'stable-privacy']), # Bond Specific vars mode=dict(type='str', default='balance-rr', choices=['802.3ad', 'active-backup', 'balance-alb', 'balance-rr', 'balance-tlb', 'balance-xor', 'broadcast']), diff --git a/tests/unit/plugins/modules/test_nmcli.py b/tests/unit/plugins/modules/test_nmcli.py index 86c34df443..c19b4d4d9e 100644 --- a/tests/unit/plugins/modules/test_nmcli.py +++ b/tests/unit/plugins/modules/test_nmcli.py @@ -3917,7 +3917,7 @@ def test_bond_connection_unchanged(mocked_generic_connection_diff_check, capfd): route_metric6=dict(type='int'), method6=dict(type='str', choices=['ignore', 'auto', 'dhcp', 'link-local', 'manual', 'shared', 'disabled']), ip_privacy6=dict(type='str', choices=['disabled', 'prefer-public-addr', 'prefer-temp-addr', 'unknown']), - addr_gen_mode6=dict(type='str', choices=['eui64', 'stable-privacy']), + addr_gen_mode6=dict(type='str', choices=['default', 'default-or-eui64', 'eui64', 'stable-privacy']), # Bond Specific vars mode=dict(type='str', default='balance-rr', choices=['802.3ad', 'active-backup', 'balance-alb', 'balance-rr', 'balance-tlb', 'balance-xor', 'broadcast']),