# Noob Question: Automating Playbook Execution

**URL:** <https://forum.ansible.com/t/noob-question-automating-playbook-execution/11853>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [August 31, 2012, 11:12pm UTC](https://forum.ansible.com/t/noob-question-automating-playbook-execution/11853 "2012-08-31T23:12:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chamberlain\_Darren](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@Chamberlain\_Darren](https://forum.ansible.com/u/Chamberlain_Darren)\
**Post date:** [August 31, 2012, 11:12pm UTC](https://forum.ansible.com/t/noob-question-automating-playbook-execution/11853/1 "2012-08-31T23:12:41Z")

</div>

This isn't an exact answer to your question, but hopefully it can  
provide you with some ideas.

We're using Jenkins[\*] as a front-end to ansible. Playbooks are  
wrapped in Jenkins jobs, which allow us to schedule and remotely  
trigger the playbooks, or have them run automatically on VCS  
commits, or in response to some other job, like a successful  
software build. Using Jenkins also allows us to capture run times,  
do fancy trending and reporting, trigger other tasks based on the  
results of a playbook run, and do all the other approximately 5  
billion things for which Jenkins plugins exist. (Seriously, Jenkins  
is pretty much the best thing ever.) Finally, ansible compliments  
Jenkins nicely, because it allows us to trivially do things like  
distribute build artifacts to mutliple clusters of app servers  
simultaneously.

(Incidentally, I'm also using Jenkins to control our puppet  
infrastructure; the pupetmaster setup that puppetlabs recommends is,  
frankly, absurd, but we have too much invested in puppet manifests  
and modules to throw it away. Our nodes are managed via multiple  
geograpically-distributed Jenkins slaves, controlled by a single  
master, which communicate over ssh, much like ansible. Honestly, if  
ansible existed when I started designing this infrastructure, I'd  
likely be triggering puppet runs from playbooks, via jenkins!)

&nbsp;&nbsp;[\*]: [http://jenkins-ci.org/](http://jenkins-ci.org/)

\* Trevor Squillario \<tsquillario at gmail.com\> [2012/08/31 12:58]:

---

<div class="post-metadata">

**Author:** ![Naween\_Ghimire](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@Naween\_Ghimire](https://forum.ansible.com/u/Naween_Ghimire)\
**Post date:** [September 20, 2014, 8:14pm UTC](https://forum.ansible.com/t/noob-question-automating-playbook-execution/11853/2 "2014-09-20T20:14:58Z")

</div>

I am currently trying to run integrate ansible runs through jenkins. If i use the --extra-vars option of ansible in the execute shell part of the jenkins job, extra quotes are added around it and ansible fails to read the values of extra-vars which renders my playbook unusable.

I would like to know how you got around this issue ?

---

<div class="post-metadata">

**Author:** ![Garrett\_Plasky](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@Garrett\_Plasky](https://forum.ansible.com/u/Garrett_Plasky)\
**Post date:** [September 21, 2014, 5:44pm UTC](https://forum.ansible.com/t/noob-question-automating-playbook-execution/11853/3 "2014-09-21T17:44:43Z")

</div>

It’s entirely possible that Jenkins is stripping the quotes prior to execution. You may want to try single vs double in this situation. Also, if you’re passing complex data to the playbook in this way you’ll need to use JSON which is going to have it’s own set of nested quoting fun. If that is the case, you may want to try passing in your variables via a separate file a la `--extra-vars "@variables.json"`. Even if Jenkins strips off the quotes in this case the @ will not be interpreted by the shell as a special character and execution should proceed.

---

<div class="post-metadata">

**Author:** ![vaida.dan](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@vaida.dan](https://forum.ansible.com/u/vaida.dan)\
**Post date:** [November 9, 2014, 11:59am UTC](https://forum.ansible.com/t/noob-question-automating-playbook-execution/11853/4 "2014-11-09T11:59:24Z")

</div>

I think you might find the answer here: [https://groups.google.com/forum/#!topic/ansible-project/wzG5BMC7h\_w](https://groups.google.com/forum/#!topic/ansible-project/wzG5BMC7h_w)
