/srv/irclogs.ubuntu.com/2022/01/11/#cloud-init.txt

=== cpaelzer_ is now known as cpaelzer
minimalTrying NoCloud seed URLs for the first time - fetching metadata and user-data from URL worked but not sure that handling of /var/lib/cloud/seed/nocloud-net/network-config worked as expected15:04
minimallogfile shows debug entry: "Seed from http://<relevant url> not supported by DataSourceNoCloud [seed=None][dsmode=net]15:06
smoseryou cannot seed network form nocloud-net15:17
smosertry /var/lib/cloud/seed/nocloud15:17
smoserminimal: https://asciinema.org/a/14577215:18
minimalok, changed to use the nocloud dir rather than nocloud-net and same debug message appears15:42
minimalyour "video" is about seeding from ISO/FAT cidata, which I've been successfully using for more than a year. Now I'm testing http/https seed urls and its the network config part (not the metadata/user-data fetch) that appears to be the issue15:44
minimalbasically in /var/lib/cloud/seed/nocloud/network-config I'm specifying both IPv4 and IPv6 DHCP but in the /e/n/i created it only specifies IPv4 DHCP15:47
smoseroh. yeah, you can't seed network data over a sedurl16:15
smoserthat makes reasonable sense.16:16
smoseryou definitely could do the whole ephemeral dhcp idea as is done on other platforms (digital ocean, ec2)16:17
smoserbut that isn't present to my knowledge on nocloud16:17
smosernoclodu is a much more generic "platform".16:18
smoseri think what you're after is reasonable but needs implementation.16:19
minimalsmoser: not trying to do network config over http - try to do it via file on filesystem16:32
smoserminimal: that should work . i think. I think i actually tested taht recently.19:24
smoseri'm not sure about eni writing... i suspect you're just getting the deault "dhcp on eth0" behavior, ratehr than explicitly writing dhcp for ipv419:25
minimalsmoser: yeah, looks like its coming from generate_fallback_config which only handles IPv4 DHCP, no IPv6 (for example)19:26
minimalso currently no way to seed metadata & user-data via URLs on a IPv6-only network for instance19:27
smoserit seems like that shoudl work.19:28
minimalit loads the file ok, it just doesn't seem to use it19:35
minimaland so then the fallback network confing kicks in and generates e/n/i with just v4 DHCP19:36
smoserminimal: https://gist.github.com/smoser/54aef9c50abf53b2dc686d51c2a4521619:37
smoserthat is just something i dumped... found a conversation from awhile ago. it isn't 100% relevant, but might helpp you along the way.19:37
minimalI haven't yet tried passing seed info via cmdline19:40
smoserhow were you doing it ?19:40
minimaljust setting seedurl in /etc/cloud/cloud.cfg and creating a /var/lib/cloud/seed/nocloud/network-config file19:41
smoseri'd have to look at code, i dont really remember.19:43
minimallooking at DataSourceNoCloud.py I notice: "# Check to see if the seed dir has data." and immediately after that it defines "user-data" and "meta-data" as required but "network-config" as optional, which implies if the 2 required values are not specified then it will ignore the "network-config" setting19:43
smoserbut maybe the lxd approach there can still help you. much faster than other ways of iterating.19:43
minimalI'll try that next to see if it changes behaviour19:43
blackboxswfalcojr: for the single JSON schema PR I have up. I'm thinking we probably don't need the Paths.schema_dir if we aren't going to support composite schema parts as separate files19:50
falcojrI agree19:50
blackboxswok falcojr thoughts on Paths.schema_path vs static in cloudinit/settings.py or not worth the additional attribute and upgrade from pickle support?19:52
falcojrI'm ok with a static path, but I think either way is fine19:53
minimalsmoser: should the cmdline specify nocloud or nocloud-net?19:54
minimalsmoser: passing via cmdline doesn't work here as (initramfs) init appears to strip entry once it sees the semicolon20:25
apathorhi. new cloud-init user here. i want to get the contents of 'v1.region' into a file on first boot. what's the right approach? 21:05
apathorso far i've tried 'write_files' and 'runcmd' but both have resulted in the literal '{{ v1.region }}' in the file instead of the resolved value21:06
blackboxswapathor, welcome. double checking now. What's your cloud-config user-data?21:07
blackboxswIt should start with ## template: jinja 21:08
blackboxsw## template: jinja21:09
blackboxsw#cloud-config21:09
blackboxswwrite_files:21:09
blackboxsw - path: /home/yep21:09
blackboxsw   content: '{{v1.region}}'21:09
apathorhttps://gist.github.com/apathor/31e3c777649327b167dbda60051820e521:10
blackboxswthe above works for me on lxc:     lxc launch ubuntu-daily:focal myname -c user.user-data="$(cat test.yaml)"21:10
blackboxswapathor you are missing #cloud-config as the 2nd line21:10
apathorah! thanks!21:10
blackboxswno worries thanks for the question21:10
blackboxswI would like us to extend cloud-init devel schema --annotate --system to handle ## template: jinja headers and report errors. Right now it only handles user-data that starts with #cloud-config. But, future us will better tell you the line failing in user-data schema.21:11
blackboxswcouple weeks and we'll be there :/21:12
apathorTBH i saw '#cloud-config' in example documents and didn't realize it was a meaningful header21:12
blackboxswfor sure, some docs/example don't contain it. You'd see logs in /var/log/cloud-init.log saying that the userdata part-001 was ignored or skipped I think (saying cloud-init didn't think it could do anything with a non-#cloud-config part)21:13
blackboxswwe try to capture docs here if helpful. https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html If you see some that don't have the header or seem confusing don't hesitate to point out bogus docs to us (or even better provide a PR at github.canonical.com/cloud-init).21:14
apathorthank you21:17
VaelaternHey quick question. Trying to boot an ubuntu 20.04.03 (irrelevant I hope) image, and append to the authorized_keys on the command line. I have a workaround to do it by templating the user-data file, but wanted to see if I could append (not replace) a public key by typing on the kernel commandline21:51
VaelaternI'll be idling, thanks :)21:51
apathorfollow up question - can jinja templates be used in /etc/cloud/cloud.cfg.d/ files or just user-data? 23:29

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