UbuntuIRC / 2020 /02 /15 /#cloud-init.txt
niansa
Initial commit
4aa5fce
[09:19] <meena> blackboxsw: so the problem then is reduced to sysconfig, and how to extract Linux specific functionality from it, by, say, using the distro classes, or building a new hierarchy, even? for ephemeral, since those actions aren't supposed to be permanent
[14:19] <and-win> Hello
[15:02] <and-win> Could someone clarify how I can determine OS type with cloud-init to use it in Jinja-template of user-data? The goal is use different `runcmd` commands depending on OS
[17:19] <blackboxsw> and-win: I don't think offhand s
[17:19] <blackboxsw> That support is there. But resolving this bug would surface that info in jinja templates. https://bugs.launchpad.net/cloud-init/+bug/1829441
[17:19] <ubot5> Ubuntu bug 1829441 in cloud-init "instance-data: surface merged cloud-config through cloud-init query command" [Wishlist,Triaged]
[17:20] <blackboxsw> As merged cloud config defines system_info.distro
[17:53] <blackboxsw> and-win: alternatively, you could have runcmd check the distro with something like [ `python3 -c 'from cloudinit.util import get_linux_distro; print(get_linux_distro()[0])'` == "redhat" ] && echo "YES"
[17:54] <blackboxsw> I realize that'll be painful. it's be best if we can simply extend cloud-init builtin variables to source cloudinit.util.get_platform_info() (which also contains get_linux_distro values too)