[09:13] <kciN> Hi
[09:16] <kciN> cc_ansible runs ansible-playbook as root instead of run_user. Is that an expected behavior? If so, how do I run ansible-playbook as myuser instead of root?
[09:18] <kciN> Or should I file a bug report?
[09:43] <kciN> Where can I see cc_ansible's output?
[10:38] <meena> kciN: in cloud-init's debug log 
[10:45] <kciN> meena: thanks, found it
[10:47] <kciN> However I still can't figure out why ansible fails to connect on initial run, but when I run it with `sudo cloud-init single --name cc_ansible` it succeeds.
[11:02] <waldi> kciN: "fails to connect"?
[11:20] <kciN> waldi yeah, ssh refuses connection
[11:21] <kciN> might be some kind of race condition like one described here: https://groups.google.com/g/ansible-project/c/iRA5IL-dLd0
[11:25] <waldi> kciN: this sounds wrong. you are already running on the system, why use ssh?
[11:28] <kciN> I'm creating several ec2 instances, one of which is an ansible tower and configures the others
[11:28] <kciN> Others are created before the tower
[11:28] <kciN> All of this is done with terraform
[11:29] <waldi> so where exactly is your problem? because tower needs to be able to handle unreachable systems on it's own
[11:30] <waldi> but anyway, this does not longer sound like a cloud-init problem, but a problem in your installed software
[11:32] <kciN> I supply cloud-init config with user_data from terraform, it runs ansible playbook, which is also uploaded with user_data. Here's why I think the problem is in cloud-init, when I run `sudo cloud-init single --name cc_ansible` everything runs fine, but when it runs on it's own, i.e. on creation, I get errors in cloud-init logs.
[11:33] <waldi> but you run on the local system, so no ssh is involved
[11:34] <waldi> except if you try to reach _another_ system
[11:35] <kciN> the tower tries to reach _another_ ec2 instance
[11:35] <waldi> so your problem is in the tower software, not cloud-init
[11:36] <kciN> look, how come `sudo cloud-init single --name cc_ansible` runs fine, but `cloud-init` itself fails?
[11:37] <kciN> Regardless of what I'm doing inside the ansible playbook
[11:38] <kciN> On an unrelated note, can I send directories with cloud-init?
[12:55] <kciN> I think the issue is caused by runcmd running after ansible
[12:55] <kciN> instead of before
[12:57] <kciN> Yes, indeed, according to /etc/cloud-init/cloud.cfg scripts-user runs after ansible