=== vrubiolo1 is now known as vrubiolo [13:33] hey, testing out the archlinux openstack image and a centos image with terraform libvirt provider, I can't seem to get cloud-init to run or at least it's not making any changes [13:34] if cloud-init is installed in the image it should just run if the commoninit.iso is mounted or? [13:34] this is on kvm/qemu [13:37] hmm I'm reading now that networking should be working, does it not work with a bridge device? [13:37] Krikke: cloud-init will run in some capacity on every boot (because it needs to check if this is a first instance boot to determine whether it should be doing anything more). Do you have a /var/log/cloud-init.log in these instances? [13:38] I have a hard time accessing the instances since I can't configure credentials to login [13:38] is it possible to mount the qcow2 images to inspect them? [13:39] I tried with this one https://linuximages.de/openstack/arch/arch-openstack-LATEST-image-bootstrap.qcow2 [13:39] and this one https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 [13:44] hmm I found out how to mount the things [13:44] checking the log now [13:47] I added my ssh rsa public key but it still asks for password on connect to ssh [13:48] 2020-09-10 13:38:06,180 - util.py[DEBUG]: Read 619 bytes from /run/cloud-init/tmp/tmpvym7iuca//user-data [13:49] OK, so cloud-init is running. [13:49] yeah seems so [13:49] And that suggests it is finding your configuration ISO. [13:49] 2020-09-10 13:38:06,180 - util.py[DEBUG]: Running command ['umount', '/run/cloud-init/tmp/tmpvym7iuca'] with allowed return codes [0] (shell=False, capture=True) [13:49] 2020-09-10 13:38:06,181 - util.py[DEBUG]: Attempting to load yaml from string of length 0 with allowed root types (,) [13:49] maybe I'm configuring it wrong [13:50] I have everything in user-data [13:50] Yeah, potentially; could you pastebin (https://paste.ubuntu.com/) your user-data? [13:51] trying with this atm https://paste.ubuntu.com/p/WhMQY4cmVf/ [13:51] I remove the public key [13:58] I don't see any mentions of my user in the logs, only the default arch user [13:58] Read 0 bytes from /home/arch/.ssh/authorized_keys [13:59] Writing to /home/arch/.ssh/authorized_keys - wb: [600] 0 bytes [13:59] it's not even the correct user [14:01] Krikke: do you have #cloud-config at the top of your user-data file ? [14:01] probably not [14:01] is that a requirement? [14:01] yes [14:01] oh [14:01] seemed like an arbitrary comment to me :D [14:02] like who forces these kind of things? [14:02] hehe [14:02] detecting whether a file is a specific sort of input needs something; [14:03] as long as it's documented somewhere [14:05] https://cloudinit.readthedocs.io/en/latest/topics/format.html [14:07] I usually skip the documentation [14:07] seems I also need to recreate the volume after fixing the config [14:09] if it's an iso, then yes [14:12] it works! [14:12] \o/ [14:13] I mean, cloud-init only runs on first boot right? [14:13] so if I want to test changes to the image I need to recreate it [14:18] Krikke: cloud-init runs on every boot; I actually recently wrote some documentation about it that hasn't landed yet: https://github.com/canonical/cloud-init/pull/568/files [14:18] As that doc outlines, cloud-init determines whether this is an instance's first boot to decide what it will execute during this particular boot. [14:19] It does this using the cache in /var/lib/cloud/; if you want to force cloud-init to detect a first boot (and therefore re-apply your configuration), then you can run `cloud-init clean`. [14:20] ok [14:20] Then reboot, to be clear. [14:20] cool [14:21] Note that that only undoes cloud-init's state: any changes you asked cloud-init to make to the system will persist. [14:21] the packages section works for archlixux right? [14:22] I can't speak from experience, but we have code that certainly suggests it should. :) [14:22] ok :) [14:22] wonder why their image doesn't provide "which" command [14:23] (And the bug link is in the topic if it doesn't. ^_^) [14:24] Most (all?) shells provide `which` builtin, that may be the thinking? [14:25] (It's in an essential package in Debian (and therefore Ubuntu), so it's likely to be on Debian-derived systems for eternity, even if people wanted to remove it; Arch may not have had their hand forced that way.) [14:27] yeah that's what is says when I do which which on my host system [14:38] starting to get there, wow this is so much nicer than nixos :D [14:56] Quote of the day right there ^ [14:57] Odd_Bloke:which is almost never a shell builtin [14:57] command -v is the posix shell builtin. [15:04] Oh, huh, I did not realise that was only a zsh thing. [15:05] any way to change the root shell? [15:06] just add root to users section? [15:11] maybe I just run chsh [15:13] hmmm, cloud init is overwriting locale-gen [15:13] /etc/locale.gen [15:18] ah I can just override that [15:39] seems the owner param doesn't work for write_files: content: [15:42] need to set them in runcmd after write_files [16:28] Krikke: owner works. it's but the user/group has to exist at the time the file is written; write-files runs before users-groups runs so that's likely what' you're seeing === MAbeeTT4 is now known as MAbeeTT [16:29] I have a branch, I need to put it up, called write-files-late, which would run after user-groups are created to sort out the write-file ownership issue with dynamically created user/groups [17:58] Krikke: that is bug https://bugs.launchpad.net/cloud-init/+bug/1486113 [17:58] Ubuntu bug 1486113 in cloud-init "write_files runs before users/groups, renders "owner" useless" [Medium,Triaged] === paride is now known as paride|off