# Running ansible playbooks in Bamboo?

**URL:** <https://forum.ansible.com/t/running-ansible-playbooks-in-bamboo/22043>\
**Category:** Ansible Project\
**Created:** [July 19, 2016, 12:28am UTC](https://forum.ansible.com/t/running-ansible-playbooks-in-bamboo/22043 "2016-07-19T00:28:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [July 19, 2016, 12:28am UTC](https://forum.ansible.com/t/running-ansible-playbooks-in-bamboo/22043/1 "2016-07-19T00:28:58Z")

</div>

I saw this post, but my problem is different.  
[https://groups.google.com/forum/#!searchin/ansible-project/ansible$20in$20bamboo/ansible-project/BvITeLL0hiA/orjip4bMAgAJ](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

---

<div class="post-metadata">

**Author:** ![slavko](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/slavko/32/8869_2.png) [@slavko](https://forum.ansible.com/u/slavko)\
**Post date:** [July 21, 2016, 10:26am UTC](https://forum.ansible.com/t/running-ansible-playbooks-in-bamboo/22043/2 "2016-07-21T10:26:23Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![viper233](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/viper233/32/2060_2.png) [@viper233](https://forum.ansible.com/u/viper233)\
**Post date:** [July 21, 2016, 4:03pm UTC](https://forum.ansible.com/t/running-ansible-playbooks-in-bamboo/22043/3 "2016-07-21T16:03:04Z")

</div>

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](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](https://confluence.atlassian.com/bamboo/creating-a-custom-elastic-image-289277146.html)
