Running ansible playbooks in Bamboo?

I saw this post, but my problem is different.
https://groups.google.com/forum/#!searchin/ansible-project/ansible$20in$20bamboo/ansible-project/BvITeLL0hiA/orjip4bMAgAJ

I have Bamboo agents that runs scripts under a “bamboo” user. Now this bamboo user needs to run ansible playbooks on a newly-created server. However, this newly-created server does NOT have the bamboo user’s ssh public key yet. So what is the recommended way of adding bamboo user’s public key to the newly-created server’s /home/bamboo/.ssh/authorized_keys file? Do I just create an image with it there already?

Thanks

If you have credentials to the host, you might create parametrized bamboo job like “bootstrap.box” , which will execute small playbook to configure new box for bamboo (like add keys, perhaps create some user and so on)

From memory, the bamboo boot process doesn’t allow any boot strapping for running user data scripts, it hides/locks that away.

https://confluence.atlassian.com/bamboo/configuring-elastic-bamboo-289277120.html

As has been suggested, run a prior job to set up the users details, or follow your suggestion of creating a custom AMI.

https://confluence.atlassian.com/bamboo/creating-a-custom-elastic-image-289277146.html