/srv/irclogs.ubuntu.com/2022/04/30/#ubuntu-server.txt

oerhekshttps://serverfault.com/a/98775300:01
sarnoldconfiguring the cloud-init datasource probably wouldn't disable the google guest agent from creating an ubuntu user00:02
FurretUberI get the user I want right. However, it creates the extra ubuntu user (it exists on default image, then is remove by the runcmd I defined, then is recreated later).00:02
sarnoldthere's something kinda funny / cute about google-guest-agent getting an "update whenever" exception and never actually updating the thing in any release https://launchpad.net/ubuntu/+source/google-guest-agent00:05
oerheksset it up right?00:09
blackboxswFurretUber: do you have example userdata that is safe for us to read that you can paste to us to confirm behavior from cloud-init side? From reading google-guest-agent code, it looks like GGA pulls usernames out of /var/lib/google/google_users00:24
blackboxswwhich may shed light on why GGA is creating that user itself instead of cloud-init. And GGA runs in the init stage at the same time as cloud-init's runcmd, so there also may be races that GGA runs after cloud-init's runcmd finishes .00:27
blackboxswto check cloud-init userdata on your system `sudo cloud-init query userdata` (but I presume you have a "users:" in your #cloud-config  that specifically omits `- default`  which is what cloud-init would have used to create the default "ubuntu" user00:28
FurretUberOk, this seems to show the relevant bits: https://paste.ubuntu.com/p/FkBr9mNs8y/ veryrandomusername does exist in the end of the process, but ubuntu is there too. Looking it again, maybe it's the SSH key?00:34
blackboxswgiven your journalctl -b 0 output it does look like you've already found the culprit as google-guest-agent there w/ it's default google_users list. https://git.launchpad.net/ubuntu/+source/google-guest-agent/tree/google_guest_agent/non_windows_accounts.go?h=ubuntu/jammy#n12500:34
sarnoldoho, I didn't expect a code browser..00:35
blackboxsw+1 your users: values indicate as you said already, ubuntu (default) user won't be created by cloud-init, this is purely contained in google-guest-agent working00:35
blackboxswgoogle's guest agent does their own provisioning of users outside of cloud-init and neither communicate with each other. so while your runcmd is "good" it still will only be run once, and GGA will continue to recreat users based on the contents of /var/lib/google/google_users I **think**00:37
blackboxswI don't know offhand what delivers that file contents.00:38
FurretUberI was grepping the source code and got to that part  now00:39
FurretUberWell, I can try to create a file there with the username I want00:39
FurretUberIf it runs after userdata, then write_files should finish first00:41
blackboxswshoot sorry I have to bail for the weekend. will peek later00:41
blackboxswwill checkin later and respond when I can. take care all00:41
FurretUberYou helped me a lot here, thank you00:41
blackboxswalso yeah quick check on source code is easily available via `snap install git-ubuntu; git-ubuntu clone google-guest-agent; cd google-guest-agent git checkout pkg/ubuntu/jammy`  or any other series folks are on if folks hadn't used git-ubuntu before00:50
blackboxswsaw some old references to image processes that seeded that /var/lib file with contents https://github.com/GoogleCloudPlatform/compute-image-packages/issues/381. not sure if relevant. ok promise I'm gone now00:51
ubottuIssue 381 in GoogleCloudPlatform/compute-image-packages "New python3 google-accounts-daemon removes ssh key from ubuntu user" [Closed]00:51
FurretUberI found what happened: there is a project-wide metadata SSH key which is from a container with gcloud where the user is called ubuntu02:00
FurretUberSo it was transferring that key. I'm sorry02:01
sarnold\o/02:01
sarnoldthanks for reporting back :)02:01
=== xispita_ is now known as xispita

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!