/srv/irclogs.ubuntu.com/2018/05/18/#cloud-init.txt

powersjthrowaway5234: your content needs to be indented00:04
powersjtry running your cloud-config through a yaml validator00:04
powersjlike http://www.yamllint.com/00:04
throwaway5234Took away a needed ! from the binary line, but that did the job.00:31
throwaway5234Thanks @rharper @powersj00:32
smoserrharper, powersj if people are asking questions like that... honestly the easiest thing to do is to let yaml.safe_dump do it.02:00
smoserhttp://paste.ubuntu.com/p/4Tqk9fNnt5/02:00
powersjsmoser: thanks we should add that to rtd for debug02:10
smoserwe have lots of "how do i write yaml" questions for sure.02:28
* blackboxsw also uses cloud-init devel schema --config-file <your-yaml-file>, which gives you that same error. 02:28
blackboxswbut admitedly that yaml traceback is not awesome for someone to debug02:29
smoserand me has 'yaml-dump' which verifies the yaml and writes it to more obvious json02:30
smoserhttp://paste.ubuntu.com/p/bKPBF7PNPt/02:30
smoseri gues though binary data is not part of json02:30
smoserso that would fail.02:30
mgerdtsIs there a plan to cut a new release sometime soon?  I'm trying to work out a strategy where (non-ubuntu) images that Joyent publishes can contain a custom build of 18.2 (or 18.5 or 18.6) without fear that vendors will release a newer package that doesn't have all of the SmartOS fixes.  18.2 came just before my fixes started rolling in.13:37
mgerdtsIn parallel, I plan to work with debian/fedora/redhat to get our patches in their official packages.13:37
smosermgerdts: https://launchpad.net/cloud-init/+milestone/18.313:42
smoserhttps://launchpad.net/cloud-init/+milestone/18.413:42
smoserwe're on rougly 3 month release cycle13:42
mgerdtsexcellent, thanks13:42
paulmeygood morning all!14:53
smoserhi paul14:54
paulmeysmoser: I have made some changes to my MP...14:54
paulmeyto get the env variable inside mount_cb, I pulled the update_env from subp to the mount_cb def14:55
paulmeydoes that sound acceptable?14:56
smoserprobalby... i think probalby fine to make 'mount' always use LANG=C also14:56
smoserbut your change seems safer from a not break things perspective14:56
paulmeyok, good14:57
paulmeyyour other remark (don't pass down the whole dsconfig, but just the preserve_ntfs flag) was very straigtforward14:58
smoser that sort of stuff makes testing  much easier.14:59
smoseri often times do the same thing as you did (maybe you were following code where i'd done that :)14:59
paulmeyalright, I'd call it ready for review then15:02
daruhey can anyone help me, I'm trying to run a script at boot, but it doesn't seem to work, I've added my script in /var/lib/cloud/scripts/per-boot/ but it doesn't seem to work, I just want to run some iptables commands, I was wondering what am I missing, thanks!15:23
smoserdaru: executable ?15:23
smoseris the file you've added executable15:23
daruyes15:24
smoserwell... that *does* work. i verified it yesterday.15:24
smosercan you run 'cloud-init collect-logs' and put the .tar.gz it creates somehwere ?15:25
darulemme see15:25
daruis that a command on cloud-init? doesn't seem to exist15:27
blackboxswthat command should exist on cloud-init 17.2 or later15:28
daruOh, I'm a bit lost, I'm running cloud-init 0.7.9 on a raspbian stretch15:31
daruit looks like hypriot is not in that version yet, thanks anyway!15:35
blackboxswdaru, no worries, you basically need to grab the following files to ease triage http://cloudinit.readthedocs.io/en/latest/topics/capabilities.html#cloud-init-collect-logs15:43
daruoh thanks, that's really helpful, already found cloud init is trying to run it on boot but fails15:47
daruis this helpful? https://paste.ee/p/nFarT#1EGl2BJ5UVLsATnNVmoILgZXSNspWoPn15:56
blackboxswdaru: so /var/lib/cloud/scripts/per-boot/set_iptables_for_internet_forwarding   has an "exec format error" it may have spewed more useful stderr into /var/log/cloud-init-output.log when run.... you can also try running /var/lib/cloud/scripts/per-boot/set_iptables_for_internet_forwarding   on the booted instance to see if it emits the failure output that is usefule16:00
daruit runs ok if I run it as root, and the other raspberries start having internet16:02
blackboxswdaru, it makes me think that the content provided in bootcmd is not valid shell. are you running it with 'sudo /var/lib/cloud/scripts/per-boot/set_iptables_for_internet_forwarding' ?16:07
blackboxswor were you running it with sudo bash /var/lib/cloud/scripts/per-boot/set_iptables_for_internet_forwarding ?16:07
daruI just did `sudo /var/lib/cloud/scripts/per-boot/set_iptables_for_internet_forwarding` and it worked (on the booted instance)16:08
daruand the content is just 3 very simple iptables rules16:09
daruIt's probably some silly mistake of mine, but i cannot see it haha16:10
smoserdaru: look in /var/log/cloud-init-output.log16:17
daruI've seen it, but I'm not seeing anything useful (I renamed the file btw)16:19
daru2018-05-18 18:17:12,558 - util.py[WARNING]: Failed running /var/lib/cloud/scripts/per-boot/set_iptables [-] 2018-05-18 18:17:12,573 - cc_scripts_per_boot.py[WARNING]: Failed to run module scripts-per-boot (per-boot in /var/lib/cloud/scripts/per-boot) 2018-05-18 18:17:12,574 - util.py[WARNING]: Running module scripts-per-boot (<module 'cloudinit.config.cc_scripts_per_boot' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_scrip16:19
smoserthat woudl be log16:19
smoserwe want cloud-init-output.log16:19
smoserwhich contains the output of the commands it ran16:19
daruI only see that kind of info in /var/log/cloud-init.log, here is https://paste.ee/p/hoLAH#08KAuIZf1l58lU8DD5UFgazCrEmTqTTv16:22
blackboxswThe file /var/log/cloud-init-output.log (contains stdout/stderr from scripts to console)   versus  /var/log/cloud-init.log which contains running debug messages about cloud-init operations16:22
blackboxswnote the -output16:23
smoseri suspect you do not have a '#!' in taht ?16:24
smoser /var/lib/cloud/scripts/per-boot/set_iptables16:24
daruI have #!/usr/bin/bash16:25
smoseris /usr/bin/bash there ?16:25
daruhere are both just in case https://paste.ee/p/47GrL#Ak9Z4hN6hviDUuh3dOOCF1XVOAcR99T616:25
darulet me see16:25
daruoh no16:26
daruit's in /bin/bash16:26
darugonna change and check, ty!16:26
daruyesss, you are the best ppl!!16:28
=== blackboxsw changed the topic of #cloud-init to: Reviews: http://bit.ly/ci-reviews | Meeting minutes: https://goo.gl/mrHdaj | Next status meeting: Monday 5/28 16:00 UTC | cloud-init 18.2 released (03/28/2018) | quotes: <daru> yesss, you are the best ppl!!!
blackboxsw:) thx daru16:29
daruthanks a lot, gonna continue my journey!16:29
=== blackboxsw changed the topic of #cloud-init to: Reviews: http://bit.ly/ci-reviews | Meeting minutes: https://goo.gl/mrHdaj | Next status meeting: Monday 5/28 16:00 UTC | cloud-init 18.2 released (03/28/2018)
blackboxswrobjo: with your noLnxDistro branch:   I'm still trying to reconcile that we already have a system_cfg: distro  value which will always be exactly what is written to your new /etc/cloud/cloud-init.user.distro in the event that someone provided --distro at build time.  The only difference is that cloud-init.user.distro only currently determines what the response from get_linux_distro() returns instead of grabbing info19:49
blackboxswfrom /etc/os-release info, whereas system_info:distro: <variant> determines which distro class is used.19:49
blackboxswsomething doesn't feel quite right, why do we need runtime get_linux_distro to get overridden by the file /etc/cloud/cloud-init.user.distro ?19:50
robjoblackboxsw: You make the assumption that the user does not change cloud.cfg, which I would say is often not the case19:51
blackboxswI'm not quite understanding why we need to persist this build time variant to runtime behavior. When I build something for platform/environment X, I expect that that rpm/deb package is configured to run on target platform/environment X. If someone installs it on environment Y, there may be runtime issues I'd expect.19:51
robjoif the user runs setup.py with --distro ubuntu and then puts centos in cloud.cfg things are going to go wrong and there will be no evidence as to why19:52
blackboxswrobjo: if the user changes cloud.cfg to say a different distro, then I'd expect cloud-init runtime to choose cloudinit.distro.<theirchoice>19:52
robjoyes, but the templates that are on the system are for ubuntu in this example and that is in some cases just not going to work19:53
blackboxswas with your branch's build time decision to build for target suse|rhel|ubuntu. Our static config templates would be created with (suse|rhel|ubuntu) in mind, so if I now install my package on a ubuntu system with suse ntp templates I can expect it to break19:53
robjosmoser: asked for this to be configurable at build time19:54
robjoI am OK without the build time switch19:54
robjobut if we have the build time switch we need evidence of what was chosen19:54
robjoI really don't care either way, I believe I worked within the guidelines provided19:55
robjoI personally would have probably stuck to leaving the detection fully automatic19:56
robjobut again, if the switch is there we need evidence as to what the "builder/installer" selected, or for certain issues we'll be up the creek with no answers and a lot of time wasted19:56
blackboxswrobjo: we have that buildtime switch that is persisted sort of, it results in the original /etc/cloud/cloud.cfg delivered (and the template selections chosen because of our templater going down if variant X paths).  Any change the user makes after cloud-init is installed I would say we don't care about. (just like with /etc/network/interfaces files). I feel like that's outside the scope of a build-time flag given.19:58
robjoOK, I will remove the file writing and reserve the right to say "I told you so" at some point in the future ;)19:59
blackboxswmaybe I'm wrong here. but minimally it feels like overriding runtime behavior of get_linux_distro is going to cause us problems, because we have overridden the original build config templates, and some of the runtime system_info() behavior, but the rest of cloud-init modules make assumptions based on a system being whatever distro it claims it is. I'd be worried about fallout.19:59
blackboxswhehe20:00
blackboxswrobjo: yeah I'll try to get a quick talk with smoser on this to make sure I'm not on my own island of insanity here20:00
smoserif it is configurable via config... and just defaults to "auto"20:01
smoserthen i thinkt hat'd be enough.20:01
smoseri would just like for someone to be able to clearly say "this is arch, you silly ubuntu developer."20:01
robjowe have the configuration option and we have the "auto" behavior by default. The question really revolves around whether or not we keep evidence that the "builder/installer" explicitly set the distro, i.e. deviated from default auto behavior20:05
robjoFrom my perspective, when one allows the user to do something evidence of that action should be collected and stored20:05
robjowhich is why I decided to write it to a file20:05
robjoBut again, I am not attached to the file, I'll remove to get this thing finally done20:06
robjosmoser: blackboxsw ^^^^20:07
blackboxswrobjo: I think I'm good with the file in /etc/cloud/ just not the runtime behavior change as a result. the file itself makes it easier to triage why rendered config content was chosen the way it was. So I think we should keep that artifact around20:08
blackboxswin a meeting on this at the moment robjo to get you an answer today20:13

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