ansible-exec: A tool to help execute playbooks

91 views
Skip to first unread message

Hagai Kariti

unread,
Aug 29, 2014, 2:58:06 PM8/29/14
to ansible...@googlegroups.com
Hi all
I wrote a little wrapper around ansible-playbook to help make playbooks executable. Thought you'll be interested.

Michael DeHaan

unread,
Aug 30, 2014, 7:47:13 AM8/30/14
to ansible...@googlegroups.com
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!






--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e710114e-4a52-40aa-b8ce-918bc00c1dc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages