tuxcrafter58 | hello all I am migrating some systems from ubuntu 20 to ubuntu 22 and the way network-manager / netplan are behaving is very different and is causing me issue. | 15:22 |
---|---|---|
tuxcrafter58 | nmcli con add type wifi con-name hq-wifi ifname wlan0 ssid "{{vault_nmcli_hq_ssid}}" used to create this file /etc/NetworkManager/system-connections/hq-wifi.nmconnection | 15:22 |
tuxcrafter58 | however on ubuntu 22 i do not have any files in /etc/NetworkManager/system-connections/ anymore | 15:22 |
tuxcrafter58 | however I do see files under /etc/netplan/ but they are sorted by some UUID and everytime I run nmcli con add type wifi con-name hq-wifi it creates a new file with UUID | 15:22 |
tuxcrafter58 | causing me to have many config files for the same network name | 15:22 |
tuxcrafter58 | I am looking for a way to know if nmcli con add type wifi con-name hq-wifi has been created without the use of any uuid if possible | 15:22 |
tuxcrafter58 | Is there a way change some config file so files are stored under /etc/NetworkManager/system-connections/ again? | 15:23 |
tuxcrafter58 | or is there a way to use nmcli con add type wifi con-name hq-wifi ifname wlan0 ssid and have config file under /etc/netplan/ that matches the con-name instead of generating a new file with an uuid, i now got a few hundred uuid config files all for the same wifi network. | 15:25 |
=== tuxcrafter58 is now known as tuxcrafter | ||
slyon | tuxcrafter: I guess you could you "nmcli con show hq-wifi", which will error out if that connection-profile does not exist | 15:29 |
slyon | alternatively, check the connection profiles generated by Netplan in /run/NetworkManager/sytem-connections. but I think those would also contain the UUID in the file name. In addition to the SSID | 15:30 |
tuxcrafter | # nmcli con show hq-wifi | wc -l | 15:30 |
tuxcrafter | 5359 | 15:30 |
tuxcrafter | Isn't it a bug that the same connection can have multiple uuids? | 15:30 |
tuxcrafter | ls -hal /run/NetworkManager/system-connections/ all those files are based on an UUID not on the nmcli con-name | 15:32 |
danilogondolfo | they can have the same name but not uuids, as far as I know | 15:32 |
tuxcrafter | I could not see the option to use nmcli con add with an UUID instead of the con-name, is there an option I am missing there? | 15:32 |
danilogondolfo | so you create connections but never delete them? | 15:32 |
danilogondolfo | how did you delete connections before? By deleting them from /etc/NetworkManager/system-connections? | 15:34 |
tuxcrafter | it used to be that con-name corresponded to a config file, so I would check for /etc/NetworkManager/system-connections/hq-wifi.nmconnection but this does not work anymore | 15:35 |
tuxcrafter | unless there is an option to revert back to this behaviour that I am missing. | 15:35 |
danilogondolfo | as slyon said, you can check it with "nmcli con show hq-wifi" or look for a file with "hq-wifi" in its name in /run/NetworkManager/sytem-connections. But you need to delete the old files first now. | 15:40 |
danilogondolfo | if you want to drop all the connections quickly you can delete /etc/netplan/90-NM-* and run netplan apply | 15:41 |
danilogondolfo | and now you need to delete the connection after finishing your tests with "nmcli con del hq-wifi" | 15:42 |
slyon | I guess you could also call `nmcli con del hq-wifi` to have all connection profiles with that name be deleted. | 15:43 |
slyon | btw: There's no way to revert back to /etc/NetworkManager/system-connections/*.nmconnection profiles. Netplan was chosen to be the single source of network configuration, as found in /etc/netplan/ | 15:44 |
tuxcrafter | Okay so the only way is to use nmcli con show hq-wifi to check if the connection exist | 15:45 |
tuxcrafter | no more reliable way to check through the file system | 15:45 |
slyon | you could "sudo netplan get | yq" and filter/process that as needed through yq, or any other YAML processing logic. But that might be overkill, given the `nmcli` commands from above. | 15:59 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!