[08:45] <joshualyle> I'm trying to find a way to write an openbsd module for cloud-init and I started looking at util.py in get_linux_distro since that's where it seems to recognize FreeBSD. However, regardless of what get_linux_distro() returns, it seems to default to use the ubuntu Distro class regardless. I can only get it to change the Distro class if it's directly set in cloud.cfg. What is the purpose of get_linux_dist
[08:45] <joshualyle> ro then?
[13:42] <meena> joshualyle: is your cloud.cfg actually saying system_info: distro: Ubuntu?
[13:42] <meena> if not, it could also be the fallthru, default
[13:44] <meena> which makes me wonder, did Goneri adapt that for his NetBSD branch?
[13:49] <meena> ah, yes, he simplified it: https://github.com/canonical/cloud-init/pull/62/files
[16:24] <Goneri> my experimental NetBSD works fine, I now need to clean up the patch, and refresh the unit-test
[16:24] <Goneri> :-)
[18:33] <joshualyle> meena: It attempts to use ubuntu regardless of if I include system_info: distro: Ubuntu in cloud.cfg or not. I was originally using a cloud.cfg that only had information for users without system_info: defined anywhere but it always identified (or fell back to) ubuntu
[18:34] <joshualyle> explicitly setting system_info: distro: openbsd was the only way I could get it to try to use an openbsd Distro class
[18:51] <joshualyle> I guess what I'm not getting is, how does cloud-init determine the class to use if it's not explicitly defined in cloud.cfg
[19:23] <meena> joshualyle: iirc, Ubuntu is default
[19:26] <joshualyle> meena: but then do you have any idea why there is so much code to discover the OS if it essentially just relies on the config file?
[19:27] <meena> the config file can override the detection, in some cases. the point is that your os doesn't have a working get_linux_distro() implemented
[19:30] <meena> Although, Goneri's implementation should work for all BSDs
[19:36] <joshualyle> I hope I'm not being annoying at this point but I guess what I still don't understand is when the detection takes effect. If the distro is defined in cloud.cfg, it is used to determine the distro class. If it is not, it seems to use settings.py to fallback to ubuntu
[19:54] <meena> joshualyle: nah, you're not annoying, it's just late here, and most of the maintainers are off until next year
[19:55] <meena> aaaaand, while i have dabbled in that code, i haven't added a whole new distro / os
[20:01] <joshualyle> alrighty I gotcha. Well I appreciate your help. I'll keep digging!
[20:04] <meena> i would just take Goneri's implementation of get_linux_distro() and start from there
[20:05] <meena> Also, his NetBSD branch might give you other ideas!
[20:05] <meena> also, https://hackmd.io/3-YBj1t9TAeKhmfLBQUjXQ
[20:06] <meena> (i'm @igalic on github, btw)
[20:34] <Goneri> joshualyle, I would like to focus on OpenBSD once NetBSD will be merged. But first, I need to figure out how to build a disk image.
[20:35] <Goneri> something like https://github.com/virt-lightning/netbsd-cloud-images
[20:35] <Goneri> this is the first step
[20:36] <Goneri> my last NetBSD qcow2 snapshot: https://virt-lightning.org/images/netbsd-8/disk.qcow2
[20:36] <Goneri> works fine with VirtLightning and OpenStack
[20:46] <joshualyle> meena: thank you! Once I figure out the structure of cloud-init in master, I'll probably branch off of Goneri's netbsd branch to see if I can figure it out for openbsd
[20:51] <joshualyle> Goneri: what exactly does that build script do? Install netbsd, add cloudinit, and reboot?
[21:01] <Goneri> it prepares an image disk, and indeed, install cloud-init after.
[21:03] <Goneri> joshualyle, to be honest, I've never used OpenBSD, so you will probably be faster than me :-)
[21:03] <Goneri> so if you've something functional, I will be happy to help.
[21:09] <Goneri> in general, the hardest part to do right, is the filesystem/partition resizing.
[21:25] <joshualyle> I appreciate it! I haven't contributed to OSS before but I've done a lot in cloud work and was sad to see the state of adoption of BSD in cloud environments so I wanted to see if I could help
[21:43] <meena> 22:09 <Goneri> in general, the hardest part to do right, is the filesystem/partition resizing.  ⬅️ cuz you're not using zfs
[23:30] <meena> I'm starting to think that a decorator is our best chance
[23:51] <Goneri> meena, there is no ZFS on OpenBSD and NetBSD, even if things are change with NetBSD-9