# How to run ansible playbook with Bamboo or jenkins

**URL:** <https://forum.ansible.com/t/how-to-run-ansible-playbook-with-bamboo-or-jenkins/21140>\
**Category:** Ansible Project\
**Created:** [April 12, 2016, 2:49pm UTC](https://forum.ansible.com/t/how-to-run-ansible-playbook-with-bamboo-or-jenkins/21140 "2016-04-12T14:49:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![imed\_khaskhoussi](https://avatars.discourse-cdn.com/v4/letter/i/919ad9/32.png) [@imed\_khaskhoussi](https://forum.ansible.com/u/imed_khaskhoussi)\
**Post date:** [April 12, 2016, 2:49pm UTC](https://forum.ansible.com/t/how-to-run-ansible-playbook-with-bamboo-or-jenkins/21140/1 "2016-04-12T14:49:35Z")

</div>

I want to execute an ansible playbook using Bamboo or jenkins. However the build failed because i can’t pass the ssh password .  
Have you any idea please ?

---

<div class="post-metadata">

**Author:** ![ananta.c](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@ananta.c](https://forum.ansible.com/u/ananta.c)\
**Post date:** [April 12, 2016, 3:58pm UTC](https://forum.ansible.com/t/how-to-run-ansible-playbook-with-bamboo-or-jenkins/21140/2 "2016-04-12T15:58:23Z")

</div>

There is an ansible plugin for jenkins, but there is no option to run on remote host ( I may be wrong) .  
I created jenkins role and was able to run ansible playbook via ssh-agent . Please check the readme file in my github and let me know your feedback

[https://github.com/ac427/my\_cm/tree/master/ansible/roles/ansible\_jenkins\_role](https://github.com/ac427/my_cm/tree/master/ansible/roles/ansible_jenkins_role)

---

<div class="post-metadata">

**Author:** ![rup](https://avatars.discourse-cdn.com/v4/letter/r/71c47a/32.png) [@rup](https://forum.ansible.com/u/rup)\
**Post date:** [April 12, 2016, 5:02pm UTC](https://forum.ansible.com/t/how-to-run-ansible-playbook-with-bamboo-or-jenkins/21140/3 "2016-04-12T17:02:49Z")

</div>

We have ssh keys established between our Jenkins server and our Ansible server. Then in the Jenkins job, we have an Execute Shell command with an entry like so…

ssh ansible@ansible\_server\_address -C “cd ~ansible/playbooks;ansible-playbook -i hostsfile site.yml --extra-vars “whatever vars you want to pass” -vv”

We have the Jenkins job set to run periodically (i.e. cron’d)
