[16:24] <ananke> I have a weird issue, where identical (and fairly simple) cloud-init config passed via AWS userdata behaves just fine on Amazon Linux 2, but on ubuntu and kali AMIs (haven't tried any more) cloud-init seems to try to actually _execute_ /var/lib/cloud/instance/user-data.txt
[16:24] <ananke> here's a sample log: http://sprunge.us/tlrTjt
[16:24] <blackboxsw> that does seem weird. have any sample userdata for us?
[16:25] <blackboxsw> wow that's strange
[16:25] <blackboxsw> ananke: I think the past of /var/log/cloud-init.log would be more helpful to supplement the cloud-init-output.log you pasted
[16:25] <ananke> now here's the interesting part: those config directives are in fact executing just fine, because files are written as per write_file, etc
[16:26] <ananke> lemme get the sample userdata
[16:26] <blackboxsw> cool `sudo cloud-init query userdata` may help on that system
[16:26] <blackboxsw> be wary of credentials :)
[16:27] <ananke> here's the userdata: https://dpaste.org/QJXDs
[16:28] <ananke> here was the full log: http://sprunge.us/NCSfcU
[16:29] <ananke> I'm going to kick off a sample ec2 instance and run that query command
[16:38] <ananke> hmm, vanilla ubuntu doesn't show those problems, wonder if it's something we have in our cloud-init's configs in AMIs we created. though I do get the error about : /var/lib/cloud/instance/scripts/runcmd: 2: source: not found
[16:38] <blackboxsw> thx for the example wonder if         ${WaitConditionHandle} needs to be escaped in this case.  but this example will give me something to play w/ in `lxc launch ubuntu-daily:kinetic -c user.user-data="$(cat your-data.yaml)"`
[16:40] <ananke> ${WaitConditionHandle} is populated by cloudformation in this case, and should be one line (though it's a long URL)
[16:40] <blackboxsw> ananke try cat ​/var/lib/cloud/instance/scripts/runcmd  I presume cloud-init shellifying your code isn't rendering what you expect it to
[16:41] <blackboxsw> you should be able to invoke that runcmd script directly with sudo to test debug expected behavior
[16:41] <ananke> thanks, I'll take a look
[16:42] <ananke> have been at this all morning. what's frustrating is that on amazon linux 2 it seems to work just fine, while the other AMIs I'm using seem to be showing those errors, AND they seem to execute the commands from `runcmd` _twice_. Once, earlier in the boot, then a minute or two later
[16:53] <ananke> ohh, interesting. 'source' error is because #!/bin/sh is used
[16:54] <ananke> wonder if amazon linux 2 uses bash to construct runcmd script
[19:00] <blackboxsw> sorry,  went into a hole on review of Ubuntu uploads for a bit. testing of lxd_container with tip of main is green  https://jenkins.canonical.com/server-team/view/cloud-init/job/cloud-init-integration-kinetic-lxd_container/50/ Azure still in progress https://jenkins.canonical.com/server-team/view/cloud-init/job/cloud-init-integration-kinetic-azure/51/.
[19:01] <blackboxsw> getting an aws runner going to confirm we are good for a quick release of tip into ubuntu kinetic
[19:04] <blackboxsw> https://jenkins.canonical.com/server-team/view/cloud-init/job/cloud-init-integration-kinetic-ec2/48/ running now too. once we see results here, I will publish https://github.com/canonical/cloud-init/pull/1625 to Ubuntu 22.10 (kinetic)