Open
Description
Summary
Locale for community.general.nmcli
is set to fixed value (still preserves in current main branch):
community.general/plugins/modules/nmcli.py
Line 2775 in 1a7aafc
Issue Type
Bug Report
Component Name
nmcli
Ansible Version
$ ansible --version
ansible [core 2.16.14]
Community.general Version
$ ansible-galaxy collection list community.general
Collection Version
----------------- -------
community.general 9.5.0
Configuration
OS / Environment
No response
Steps to Reproduce
- name: Configure NetworkManager connection
community.general.nmcli:
conn_name: "{{ ansible_primary_interface_connection.name | default(ansible_primary_interface) }}"
ifname: "{{ ansible_primary_interface }}"
type: ethernet
ip4: "{{ ansible_network_ip }}/{{ ansible_network_prefix }}"
gw4: "{{ ansible_network_gateway }}"
dns4: "{{ online_dns }}"
route_metric4: "{{ metric }}"
state: present
Expected Results
community.general.nmcli
will modify existing connection (UTF-8 name) if already exists
Actual Results
community.general.nmcli
will always create new connection (UTF-8 name) no matter whether it exists.
Adding some debug code to result:
TASK [system.network : Configure NetworkManager connection] ******************************************************************************************************************************
changed: [ubuntu-Precision-7920-Tower] => {"Connection": "Connection 有线连接 1 of Type ethernet is being added", "changed": true, "conn_name": "有线连接 1", "debug_conn_name": "有线连接 1", "debug_connection_info": ["???? 1", "br-646e2caad030", "docker0", "VPN 1"], "state": "present", "stdout": "Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/42)\n", "stdout_lines": ["Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/42)"]}
In nmcli command output invoked from module, 有线连接 1
becomes ???? 1
which makes connection_exists
check always fail:
community.general/plugins/modules/nmcli.py
Lines 2319 to 2327 in 1a7aafc
Code of Conduct
- I agree to follow the Ansible Code of Conduct