# ansible-exec: A tool to help execute playbooks

**URL:** <https://forum.ansible.com/t/ansible-exec-a-tool-to-help-execute-playbooks/16076>\
**Category:** Ansible Project\
**Created:** [August 29, 2014, 6:58pm UTC](https://forum.ansible.com/t/ansible-exec-a-tool-to-help-execute-playbooks/16076 "2014-08-29T18:58:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hagai\_Kariti](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@Hagai\_Kariti](https://forum.ansible.com/u/Hagai_Kariti)\
**Post date:** [August 29, 2014, 6:58pm UTC](https://forum.ansible.com/t/ansible-exec-a-tool-to-help-execute-playbooks/16076/1 "2014-08-29T18:58:06Z")

</div>

Hi all  
I wrote a little wrapper around ansible-playbook to help make playbooks executable. Thought you’ll be interested.

More details here: [http://blog.bigpanda.io/ansible-exec-ansible-playbook-wrapper-for-executing-playbooks](http://blog.bigpanda.io/ansible-exec-ansible-playbook-wrapper-for-executing-playbooks)

---

<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:** [August 30, 2014, 11:47am UTC](https://forum.ansible.com/t/ansible-exec-a-tool-to-help-execute-playbooks/16076/2 "2014-08-30T11:47:02Z")

</div>

As an interesting sidenote, you can also do this by putting a shebang line in your YAML and making your playbook executable. (This trick supplied a while ago by Brian Coca)

# /usr/bin/env ansible-playbook

Many of the common options, such as defaults for “-i”, can be set in an ~/.ansible.cfg, or /etc/ansible/ansible.cfg.

I do see what you have there with variable syntax around “-e” and other options not defined being fed to -e, though the likely downside of this is typos become variables, which is why we avoid this.

–inventoyr=foo.txt, etc, could accidentally define a variable.

Still, a neat trick. Thanks for sharing!
