# Triggering a Jenkins build through ansible

**URL:** <https://forum.ansible.com/t/triggering-a-jenkins-build-through-ansible/25259>\
**Category:** Ansible Developer\
**Created:** [August 15, 2017, 3:44pm UTC](https://forum.ansible.com/t/triggering-a-jenkins-build-through-ansible/25259 "2017-08-15T15:44:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seeram\_Venkatesh](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@Seeram\_Venkatesh](https://forum.ansible.com/u/Seeram_Venkatesh)\
**Post date:** [August 15, 2017, 3:44pm UTC](https://forum.ansible.com/t/triggering-a-jenkins-build-through-ansible/25259/1 "2017-08-15T15:44:06Z")

</div>

Hi Techies,

I’m looking for a solution where I want to trigger a Jenkins build through Ansible.  
I went through a module called **jenkins\_job** from which I can connect to the jenkins server but not able to trigger a new build.  
Please help me here and TIA.

---

<div class="post-metadata">

**Author:** ![Nicholas\_Choate](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@Nicholas\_Choate](https://forum.ansible.com/u/Nicholas_Choate)\
**Post date:** [April 16, 2018, 1:03pm UTC](https://forum.ansible.com/t/triggering-a-jenkins-build-through-ansible/25259/2 "2018-04-16T13:03:16Z")

</div>

The **jenkins\_job** will create a jenkins job for you but it won’t run it. The way I got around this was calling the Jenkins REST API via the **uri** task. Keep in mind you’ll need to call the API to get a Jenkins Crumb first, then another call to trigger the build.
