# Using Ansible to provision Jenkins

**URL:** <https://forum.ansible.com/t/using-ansible-to-provision-jenkins/18685>\
**Category:** Ansible Project\
**Created:** [July 6, 2015, 9:31am UTC](https://forum.ansible.com/t/using-ansible-to-provision-jenkins/18685 "2015-07-06T09:31:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anthony\_Green](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@Anthony\_Green](https://forum.ansible.com/u/Anthony_Green)\
**Post date:** [July 6, 2015, 9:31am UTC](https://forum.ansible.com/t/using-ansible-to-provision-jenkins/18685/1 "2015-07-06T09:31:06Z")

</div>

I’m using Ansible to provision a machine with Jenkins within a Docker container

As part of the provisioning process I wait until Jenkins is running and then download the CLI to continue the provisioning by executing CLI commands.  
The jar file is being downloaded to the host machine.

I was wondering if this was necessarily the best approach ?  
Could the CLI jar be downloaded to my workstation instead and the commands executed from there?  
Could I use Groovy scripts to provision the machine ?  
Other suggestions?

---

<div class="post-metadata">

**Author:** ![Maekawa\_Naomi](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Maekawa\_Naomi](https://forum.ansible.com/u/Maekawa_Naomi)\
**Post date:** [July 6, 2015, 1:44pm UTC](https://forum.ansible.com/t/using-ansible-to-provision-jenkins/18685/2 "2015-07-06T13:44:08Z")

</div>

hi anthony,

you can check delegation and local\_action to download the jenkins cli to your local workstation:  
[https://docs.ansible.com/playbooks\_delegation.html](https://docs.ansible.com/playbooks_delegation.html)

best,  
naomi.

---

<div class="post-metadata">

**Author:** ![Adithya\_Khamithkar](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Adithya\_Khamithkar](https://forum.ansible.com/u/Adithya_Khamithkar)\
**Post date:** [July 20, 2015, 3:52am UTC](https://forum.ansible.com/t/using-ansible-to-provision-jenkins/18685/3 "2015-07-20T03:52:28Z")

</div>

You could have a look at this.  
[https://github.com/adithyakhamithkar/ansible/blob/master/roles/jenkins-configure/tasks/main.yml](https://github.com/adithyakhamithkar/ansible/blob/master/roles/jenkins-configure/tasks/main.yml)
