Open dummys opened 2 years ago
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @alcamie101 click here for bot help
The module first add the connection and then modify it to add like psk or something ?
Exactly. This module originally created a WiFi connection and included all settings via the command line. Among those commands were secrets which could be leaked through the proc table. To fix this the connection is first added and then secrets are entered via stdin over the interactive edit prompt. See #3145 for more information.
ok so thats why we have such lots of output. And I can safely script something to only choose the 12th element and then split on space etc ? It will never change ?
No, the stdout will never be safe and is subject to change based on nmcli/NetworkManager version and local system settings. You change this issue into a request for stable return values from the module or if you are in a hurry:
- name: Retrieve UUID from nmcli
ansible.builtin.command:
cmd: "nmcli -f 'connection.uuid' con show {{ item.conn_name }}"
loop: "{{ network.wireless }}"
oh yeah ok will do this, thanks.
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
Summary
When addind a connection wifi using nmcli module, the output said that it edit the actual connection, even if the connection didnt exist before. To control it:
nmcli conn delete test_con
my vars:And my roles:
and the output:
So my question is, why it said that the connection already exist even if I deleted it successfully before ? The module first add the connection and then modify it to add like psk or something ? PS: I tried with ethernet connection and it works correctly, the output is only one line with:
"stdout_lines": [ "Connection 'test_con_eth' (dd165caf-6fb5-49a9-8e35-43637fd76476) successfully added."
When I use nmcli command to add it manually it works as expected:
nmcli conn add type wifi conn_name test_con ssid test_con 802-11-wireless-security.key-mgmt wpa-psk 802-11-wireless-security.psk lol
Issue Type
Bug Report
Component Name
nmcli
Ansible Version
Community.general Version
Configuration
OS / Environment
Arch linux
Steps to Reproduce
Expected Results
only one line with:
"Connection 'test_con' (dd165caf-6fb5-49a9-8e35-43637fd76476) successfully added."
Actual Results
Code of Conduct