There's the cloud-init docs, which have gotten a bit better recently (they were almost wilfully obscure when I started working with it several years ago!). The Reference / Module reference section is the part I usually find most useful, particularly now there are schemas & examples for each module.
However, for getting started with it, I'd suggest just looking at the examples I bunged on the boot partition. If you flash a fresh Ubuntu Server for Pi image onto a card, then have a look on the boot partition, you'll see the following files which form the cloud-init "seed" (i.e. its initial configuration):
But be warned this doesn't undo absolutely everything (there's a lot of corner cases) so always test with a completely clean image before deciding a configuration is "correct".
Hope that helps!
However, for getting started with it, I'd suggest just looking at the examples I bunged on the boot partition. If you flash a fresh Ubuntu Server for Pi image onto a card, then have a look on the boot partition, you'll see the following files which form the cloud-init "seed" (i.e. its initial configuration):
- network-config -- This is the initial netplan configuration used on first boot; I left some examples of wifi setup in here along with the usual eth0 setup
- meta-data -- The default here tells cloud-init not to look for a network-based seed, via dsmode (just the stuff on the boot partition)
- user-data -- This is the bulk of the cloud-init configuration, providing the initial user, packages, apt specs, etc etc. Again, I left a few commented examples in here which may provide some ideas of what's possible
Code:
sudo cloud-init clean --logs --reboot
Hope that helps!
Statistics: Posted by waveform80 — Fri Jan 26, 2024 4:13 pm