[17:00] <SiwelG> Hey, wondering if there's any docs/pointers for setting up a cloud image for a currently-unsupported distro?
[17:00] <SiwelG> e.g. how to install/configure cloud-init
[17:23] <minimal> SiwelG: don't think there's any specific docs
[17:24] <minimal> I have my own script for creating Alpine linux disk images with cloud-init setup
[17:24] <SiwelG> that's exactly what I'm looking to do, don't suppose you'd be open to sharing them, even if just for inspiration? :)
[17:26] <minimal> SiwelG: https://github.com/dermotbradley/create-alpine-disk-image
[17:26] <minimal> https://github.com/dermotbradley/create-alpine-disk-image/blob/main/lib/disk-image-functions#L1179 is where cloud-init itself is configured but there is other OS-specific stuff that needs to be done also
[17:28] <SiwelG> thanks! will take a look
[17:29] <minimal> basically you'd need to prepare an OS image somehow (i.e. in a chroot/via Packer) and then install cloud-init there, enable the cloud-init init.d/systemd services, proably tweak /etc/cloud/cloud.cfg, and end up with a disk image/VM image that you can then deploy
[17:30] <SiwelG> "prepare an OS image somehow (i.e. in a chroot/via Packer)" could also presumably be done by manually installing from an ISO?
[17:30] <SiwelG> but that defeats the point a bit as you'd have to configure stuff you'd normally do in cloud-init?
[17:31] <minimal> install where though? to a loopback device? to an actual hard disk?
[17:31] <SiwelG> hard disk
[17:31] <minimal> cloud-init cannot configure itself (and things it depends upon) so that's why someone has to create a cloud-init enabled OS image
[17:32] <SiwelG> yes, I was wondering if it would be feasible to install an ISO in a qcow2 hard disk with QEMU, then manually install cloud-init inside the booted OS such that further configuration could be performed by cloud-init on a subsequent boot?
[17:34] <minimal> possibly but that sort of defeats the point of cloud-init - the idea (certainly for VMs and Cloud instances) is to have a base OS image which already has cloud-init as part of it
[17:35] <minimal> that's why I use my script to also build disk images for physical machines (like PCs and Raspberry PIs) where I simply "dd" the created disk image onto the machine and then boot it for the 1st time
[17:36] <minimal> so if I want to install 3 PCs using the same disk image I just need to modify the cloud-init YAML files before 1st boot to set hostname, network info, locale, timezone, user accounts to create, etc
[17:36] <SiwelG> indeed, but it might actually be fine for my use-case... I just want a single cloud-init base image that can be used as a template with configuration based on a cloud-init config file
[17:37] <minimal> so you're agreeing with me - you want to create a "template" OS image, which is where Packer/chroot etc typically provide the means
[17:37] <minimal> which distro?
[17:39] <SiwelG> I was going to be looking at Alpine, but just investigating what it takes to get cloud-init set up in general
[17:41] <minimal> don't think of cloud-init as a "normal" package that you install on any system
[17:41] <SiwelG> ah ok
[17:41] <minimal> rather its a "special" package that is used to build OS images
[17:42] <minimal> e,g. for Debian you can download the normal ISO/USB stick-based installer
[17:42] <minimal> however Debian also have "cloud" images for download which are with cloud-init preinstalled and configured
[17:42] <minimal> likewise for most distros
[17:42] <SiwelG> I'm fine with manually doing the work to create a disk image from an ISO, but I was hoping to then use cloud-init to take that qcow2 image and create different variants of it
[17:43] <SiwelG> yes I do understand what you're explaining already, possibly I've made it seem like I know less than I do :)
[17:43] <minimal> if you look at my script it is exactly for creating various variants of cloud-init enabled Alpine, e.g. Virtualbox specific, QEMU specific, AWS specific, Raspberry Pi specific, etc
[17:45] <minimal> so for example with the AWS variant the aws-cli package is installed and the AWS-specific "ena" network device kernel module is available
[17:48] <SiwelG> yeah, I was just hoping for something a bit simpler than a 6000 line script in terms of understanding what's going on aha, still not sure I understand why installing an ISO and using the package manager to install cloud-init wouldn't work?
[17:54] <minimal> SiwelG: hint, its a script to create a script :-) If you run it (with no privs) it will spit aout a 500-600 script tailored for what you specified
[17:55] <SiwelG> yah I saw :p  sorry, doing a few things at once, will try it out
[17:55] <minimal> SiwelG: typically if you use a distro's normal installer it will result in things like hostname, SSH host keys etc being created which you will then have to remove from the base image as you don't want that in it
[17:56] <SiwelG> right I thought that would be the case, and that's my point - I don't care about those things being already configured as they're not things I want to configure with cloud-init
[17:57] <minimal> why not just use whichever distro's own cloud image?
[17:58] <SiwelG> Because I wanted to try Alpine or another minimal distro, or possibly old versions/uncommon architectures
[17:58] <minimal> ok, there is an "official" Alpine cloud image (not done by me) but its for AWS only (currently)
[17:58] <SiwelG> yeah I saw, I don't think it's one I can use
[17:59] <minimal> BTW I'm the Alpine package maintainer for cloud-init :-)
[18:00] <SiwelG> Ah nice, as in you create the Alpine cloud images, or you maintain the cloud-init package that can be installed on Alpine?
[18:01] <minimal> as in I maintain the Alpine cloud-init package and I upstreamed Alpine support to cloud-init and submit occasional patches upstream to improve both cloud-init on Alpine and cloud-init in general
[18:01] <minimal> https://pkgs.alpinelinux.org/package/edge/community/x86_64/cloud-init
[18:02] <SiwelG> Nice work, appreciated :)
[18:03] <minimal> I don't create the "official" Alpine cloud-init download (those guys build using Package and they are not currently using cloud-init, they are using tiny-init which is an AWS-only alternative to cloud-init)
[18:03] <minimal> s/Package/Packer/
[18:04] <minimal> you might want to have a look at README.Alpine in the cloud-init-doc package
[18:04] <minimal> that Alpine package I mean
[18:04] <minimal> aka https://git.alpinelinux.org/aports/tree/community/cloud-init/README.Alpine
[18:09] <SiwelG> thanks. I might have to come back to have a play with this later, might ask again if I get stuck
[18:11] <minimal> SiwelG: no problems. Happy to help. I'm often on here and on the alpine-channels (on OFTC) also. Plus my email's in the Alpine package
[18:11] <SiwelG> Thanks a lot!
[18:12] <minimal> that README is as close to a guide as to how-to-setup-cloud-init as I've got - its a small audience interested in doing so and so didn't think it was worth the effort to document in detail - my script is "living" documentation :-)
[18:12] <SiwelG> that's great, definitely a big step towards what I was looking for
[18:14] <minimal> SiwelG: I'm also working on some patches to Alpine's cloud-utils-growpart and cloud-init to reduce dependancies further (with MRs/PRs going upstream for this)
[18:15] <SiwelG> keep up the good work, is this all done in your free time?
[18:17] <minimal> yupe