You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I try to setup a wifi connection profile with psk-flags set to "1" when psk-flags is already set to "1" on the existing connection profile, then ansible reports a change has been made even though no change should be made.
Also, maybe related: at the time of this writing the documentation and Network Manager API state that "psk-flags" should be a list of integers; but execution fails with an error that the list should be composed of strings if an integer list is used.
When specifying psk-flags as a list of integers, the following error occurs:
The full traceback is:
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-tmp-1731362593.5422006-1090995-80250802680489/AnsiballZ_nmcli.py", line 107, in <module>
_ansiballz_main()
File "/root/.ansible/tmp/ansible-tmp-1731362593.5422006-1090995-80250802680489/AnsiballZ_nmcli.py", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/root/.ansible/tmp/ansible-tmp-1731362593.5422006-1090995-80250802680489/AnsiballZ_nmcli.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.nmcli', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.nmcli', _modlib_path=modlib_path),
File "/usr/lib64/python3.9/runpy.py", line 225, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib64/python3.9/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/tmp/ansible_nmcli_payload_nd_x0qw0/ansible_nmcli_payload.zip/ansible_collections/community/general/plugins/modules/nmcli.py", line 2669, in <module>
File "/tmp/ansible_nmcli_payload_nd_x0qw0/ansible_nmcli_payload.zip/ansible_collections/community/general/plugins/modules/nmcli.py", line 2641, in main
File "/tmp/ansible_nmcli_payload_nd_x0qw0/ansible_nmcli_payload.zip/ansible_collections/community/general/plugins/modules/nmcli.py", line 2235, in modify_connection
File "/tmp/ansible_nmcli_payload_nd_x0qw0/ansible_nmcli_payload.zip/ansible_collections/community/general/plugins/modules/nmcli.py", line 2196, in connection_update
File "/tmp/ansible_nmcli_payload_nd_x0qw0/ansible_nmcli_payload.zip/ansible_collections/community/general/plugins/modules/nmcli.py", line 1947, in connection_options
File "/tmp/ansible_nmcli_payload_nd_x0qw0/ansible_nmcli_payload.zip/ansible_collections/community/general/plugins/modules/nmcli.py", line 2099, in list_to_string
TypeError: sequence item 0: expected str instance, int found
fatal: [***]: FAILED! => {
"changed": false,
"module_stderr": "Shared connection to *** closed.\r\n",
"module_stdout": "Traceback (most recent call last):\r\n File \"/root/.ansible/tmp/ansible-tmp-1731362593.5422006-1090995-80250802680489/AnsiballZ_nmcli.py\", line 107, in <module>\r\n _ansiballz_main()\r\n File \"/root/.ansible/tmp/ansible-tmp-1731362593.5422006-1090995-80250802680489/AnsiballZ_nmcli.py\", line 99, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/root/.ansible/tmp/ansible-tmp-1731362593.5422006-1090995-80250802680489/AnsiballZ_nmcli.py\", line 47, in invoke_module\r\n runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.nmcli', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.nmcli', _modlib_path=modlib_path),\r\n File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\r\n _run_code(code, mod_globals, init_globals,\r\n File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_nmcli_payload_nd_x0qw0/ansible_nmcli_payload.zip/ansible_collections/community/general/plugins/modules/nmcli.py\", line 2669, in <module>\r\n File \"/tmp/ansible_nmcli_payload_nd_x0qw0/ansible_nmcli_payload.zip/ansible_collections/community/general/plugins/modules/nmcli.py\", line 2641, in main\r\n File \"/tmp/ansible_nmcli_payload_nd_x0qw0/ansible_nmcli_payload.zip/ansible_collections/community/general/plugins/modules/nmcli.py\", line 2235, in modify_connection\r\n File \"/tmp/ansible_nmcli_payload_nd_x0qw0/ansible_nmcli_payload.zip/ansible_collections/community/general/plugins/modules/nmcli.py\", line 2196, in connection_update\r\n File \"/tmp/ansible_nmcli_payload_nd_x0qw0/ansible_nmcli_payload.zip/ansible_collections/community/general/plugins/modules/nmcli.py\", line 1947, in connection_options\r\n File \"/tmp/ansible_nmcli_payload_nd_x0qw0/ansible_nmcli_payload.zip/ansible_collections/community/general/plugins/modules/nmcli.py\", line 2099, in list_to_string\r\nTypeError: sequence item 0: expected str instance, int found\r\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
Code of Conduct
I agree to follow the Ansible Code of Conduct
The text was updated successfully, but these errors were encountered:
Summary
If I try to setup a wifi connection profile with psk-flags set to "1" when psk-flags is already set to "1" on the existing connection profile, then ansible reports a change has been made even though no change should be made.
Also, maybe related: at the time of this writing the documentation and Network Manager API state that "psk-flags" should be a list of integers; but execution fails with an error that the list should be composed of strings if an integer list is used.
Issue Type
Bug Report
Component Name
nmcli
Ansible Version
Community.general Version
Configuration
OS / Environment
The server running Ansible is Rocky Linux 9:
The PC the wifi network connection creation attempt is made is Fedora KDE Workstation 41:
Steps to Reproduce
Save this to test_wireless.yml.
Run the following command twice.
ansible-playbook -i hosts test_wireless.yml -vvv
Every subsequent execution should result in a diff even though no changes should/need be made.
Save this to test_wireless2.yml and execute it with the following command:
ansible-playbook -i hosts test_wireless.yml -vvv
Expected Results
I expected psk-flags to NOT report nor apply any change to the network connection profile when the same flags are set on every invocation.
I expected psk-flags to be a list of integers, but it expects strings instead.
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: