/srv/irclogs.ubuntu.com/2019/12/22/#cloud-init.txt

joshualyleI'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_dist08:45
joshualylero then?08:45
=== tds6 is now known as tds
=== tds8 is now known as tds
=== tds1 is now known as tds
meenajoshualyle: is your cloud.cfg actually saying system_info: distro: Ubuntu?13:42
meenaif not, it could also be the fallthru, default13:42
meenawhich makes me wonder, did Goneri adapt that for his NetBSD branch?13:44
meenaah, yes, he simplified it: https://github.com/canonical/cloud-init/pull/62/files13:49
=== QuosqueTandem is now known as hggdh
Gonerimy experimental NetBSD works fine, I now need to clean up the patch, and refresh the unit-test16:24
Goneri:-)16:24
joshualylemeena: 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) ubuntu18:33
joshualyleexplicitly setting system_info: distro: openbsd was the only way I could get it to try to use an openbsd Distro class18:34
joshualyleI guess what I'm not getting is, how does cloud-init determine the class to use if it's not explicitly defined in cloud.cfg18:51
meenajoshualyle: iirc, Ubuntu is default19:23
joshualylemeena: 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:26
meenathe config file can override the detection, in some cases. the point is that your os doesn't have a working get_linux_distro() implemented19:27
meenaAlthough, Goneri's implementation should work for all BSDs19:30
joshualyleI 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 ubuntu19:36
meenajoshualyle: nah, you're not annoying, it's just late here, and most of the maintainers are off until next year19:54
meenaaaaaand, while i have dabbled in that code, i haven't added a whole new distro / os19:55
joshualylealrighty I gotcha. Well I appreciate your help. I'll keep digging!20:01
meenai would just take Goneri's implementation of get_linux_distro() and start from there20:04
meenaAlso, his NetBSD branch might give you other ideas!20:05
meenaalso, https://hackmd.io/3-YBj1t9TAeKhmfLBQUjXQ20:05
meena(i'm @igalic on github, btw)20:06
Gonerijoshualyle, 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:34
Gonerisomething like https://github.com/virt-lightning/netbsd-cloud-images20:35
Gonerithis is the first step20:35
Gonerimy last NetBSD qcow2 snapshot: https://virt-lightning.org/images/netbsd-8/disk.qcow220:36
Goneriworks fine with VirtLightning and OpenStack20:36
joshualylemeena: 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 openbsd20:46
joshualyleGoneri: what exactly does that build script do? Install netbsd, add cloudinit, and reboot?20:51
Goneriit prepares an image disk, and indeed, install cloud-init after.21:01
Gonerijoshualyle, to be honest, I've never used OpenBSD, so you will probably be faster than me :-)21:03
Goneriso if you've something functional, I will be happy to help.21:03
Goneriin general, the hardest part to do right, is the filesystem/partition resizing.21:09
joshualyleI 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 help21:25
meena22:09 <Goneri> in general, the hardest part to do right, is the filesystem/partition resizing.  ⬅️ cuz you're not using zfs21:43
meenaI'm starting to think that a decorator is our best chance23:30
Gonerimeena, there is no ZFS on OpenBSD and NetBSD, even if things are change with NetBSD-923:51

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