# Ansible + Jenkins

**URL:** <https://forum.ansible.com/t/ansible-jenkins/16768>\
**Category:** Ansible Project\
**Created:** [November 13, 2014, 8:27am UTC](https://forum.ansible.com/t/ansible-jenkins/16768 "2014-11-13T08:27:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_T](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@Alex\_T](https://forum.ansible.com/u/Alex_T)\
**Post date:** [November 13, 2014, 8:27am UTC](https://forum.ansible.com/t/ansible-jenkins/16768/1 "2014-11-13T08:27:53Z")

</div>

Hi!  
Everybody knows, how to run ansible playbook from jenkins ci?

---

<div class="post-metadata">

**Author:** ![Torsten\_Reinhard](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@Torsten\_Reinhard](https://forum.ansible.com/u/Torsten_Reinhard)\
**Post date:** [November 15, 2014, 8:47am UTC](https://forum.ansible.com/t/ansible-jenkins/16768/2 "2014-11-15T08:47:08Z")

</div>

Hi,

why dont use a “Shell” Buildstep and inside just do:

ansible-playbook –i /path/to/hosts playbook.yml –v –extra-vars … and so on?

Of course you need an Ansible installation on your system, first.

That´s the way how I´ve setup this – and all playbooks are executed immediately after a SVN commit – running against local virtual environments.

Regards, Torsten

---

<div class="post-metadata">

**Author:** ![Manuel\_Jesus\_Recena](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@Manuel\_Jesus\_Recena](https://forum.ansible.com/u/Manuel_Jesus_Recena)\
**Post date:** [November 17, 2014, 12:08pm UTC](https://forum.ansible.com/t/ansible-jenkins/16768/3 "2014-11-17T12:08:01Z")

</div>

Hello Alex,

As Torsten said you, you can use "Shell buildstep" and invoke your  
playbook (Ansible).  
At ClinkerHQ (Hosted CI service based on Jenkins) you can available  
Ansible Playbook.

Disclaimer: I work at ClinkerHQ.

Regards,

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [November 17, 2014, 2:03pm UTC](https://forum.ansible.com/t/ansible-jenkins/16768/4 "2014-11-17T14:03:27Z")

</div>

You can use ‘Publish over SSH’ module to call a remote system running ansible.  
Configure your ansible host in Jenkins → Manage Jenkins → Configure System  
Then you can add a post build action called ‘Send Build artifacts over ssh’. Select your ansible host and then in the Transfers section, specify commands to run on your ansible host. You don’t actually have to transfer files with this action.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [November 17, 2014, 8:39pm UTC](https://forum.ansible.com/t/ansible-jenkins/16768/5 "2014-11-17T20:39:51Z")

</div>

An alternative, which you may like, is to install Ansible Tower, and then use ansible-tower-cli in your shell step.

It makes integration with Jenkins a one liner.

It will get you nicer output, particularly for a larger number of hosts, than Jenkins, and also some nice ways to edit inventory and identify problems.

---

<div class="post-metadata">

**Author:** ![Azul](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@Azul](https://forum.ansible.com/u/Azul)\
**Post date:** [December 5, 2014, 5:50pm UTC](https://forum.ansible.com/t/ansible-jenkins/16768/6 "2014-12-05T17:50:00Z")

</div>

I use jenkins heavily for orchestration, in a setup where I have multiple jenkins CD pipelines in different environments all deploying code using Ansible.

See this setup below, it’s an example for deploying jenkins, setting up the jobs and dependencies.  
It also shows how to provisioning and configure a zabbix box using Ansible executed from a jenkins job,  
you should be able to adapt it to execute anything you like

[https://github.com/Azulinho/ansible-jenkins-showcase](https://github.com/Azulinho/ansible-jenkins-showcase)

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [December 6, 2014, 1:57am UTC](https://forum.ansible.com/t/ansible-jenkins/16768/7 "2014-12-06T01:57:13Z")

</div>

or check out Tower 🙂

---

<div class="post-metadata">

**Author:** ![abraham](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@abraham](https://forum.ansible.com/u/abraham)\
**Post date:** [September 15, 2015, 5:48am UTC](https://forum.ansible.com/t/ansible-jenkins/16768/8 "2015-09-15T05:48:52Z")

</div>

i configure like as below for ci

1)i configured Jenkins,maven and git  
2) In that .war file to upload to S3 bucket uisng publish artifacts to s3 bucket plugin  
3) create new EC2 instance using cloud formation template from S3 bucket using cloud formation plugin  
4) now i want to configure Ansible plugin in jenkins how to configure please help me …
