When setting the method for IPv6 to "disabled" or "ignore", and there are IPv6 addresses already defined in the config, the module cannot set the new method. May need to have a condition to remove the addresses from the config before setting the method to allow this to work properly. This may extend past addresses and include gateway or routes as well, but I have not performed any additional testing. This may also extend to IPv4 method setting to "disabled" as well.
- name: Set an ipv6 address
community.general.nmcli:
conn_name: ens192
ip6: "::1"
state: present
- name: Set ipv6 method to disabled
community.general.nmcli:
conn_name: ens192
method6: disabled
state: present
Expected Results
ipv6.method to be set to "disabled" or "ignore" successfully. If the connection has existing ipv6 addresses configured, they would be removed.
Actual Results
Error: Failed to modify connection 'ens192': ipv6.addresses: this property is not allowed for 'method=disabled'\n
Error: Failed to modify connection 'ens192': ipv6.addresses: this property is not allowed for 'method=ignore'\n
Summary
When setting the method for IPv6 to "disabled" or "ignore", and there are IPv6 addresses already defined in the config, the module cannot set the new method. May need to have a condition to remove the addresses from the config before setting the method to allow this to work properly. This may extend past addresses and include gateway or routes as well, but I have not performed any additional testing. This may also extend to IPv4 method setting to "disabled" as well.
Issue Type
Bug Report
Component Name
nmcli
Ansible Version
Community.general Version
Configuration
OS / Environment
RHEL 9.4
Steps to Reproduce
Expected Results
ipv6.method to be set to "disabled" or "ignore" successfully. If the connection has existing ipv6 addresses configured, they would be removed.
Actual Results
Code of Conduct