Skip to content
This repository was archived by the owner on Mar 23, 2022. It is now read-only.

Commit

Permalink
Add ansible-playbook wrapper script
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael G. Noll committed Jun 24, 2014
1 parent d86fcab commit 0372972
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ BACKWARDS INCOMPATIBILITIES

IMPROVEMENTS

* Add `ansible-playbook` wrapper script.
* bootstrap: Use new GitHub.com URL for retrieving raw user content.
* WS-10: source rvm script after ruby-bootstrap so that libarian-puppet is found (thanks neeleshs)
* WS-6: Fix Puppet installation on latest Amazon Linux AMI when creating custom AMIs
Expand Down
31 changes: 31 additions & 0 deletions ansible-playbook
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
#
# File: ansible-playbook
# Description: A simple wrapper around `ansible-playbook` that pre-configures several
# Ansible settings so that it works out of the box with
# Wirbelsturm/Vagrant.

MYSELF=`basename $0`
MY_DIR=`echo $(cd $(dirname $0); pwd)`
. $MY_DIR/sh/common.sh

ANSIBLE_PLAYBOOK_BIN="ansible-playbook"

# Disable SSH host key verification. Disabling the verification is usually
# required because of the way Vagrant creates guest VMs (the host keys of
# the VMs may change in between restarts).
export ANSIBLE_HOST_KEY_CHECKING=False

# This script queries Vagrant and parses wirbelsturm.yaml to compile a
# dynamic inventory list of (running) hosts for Ansible.
EXTERNAL_INVENTORY_SCRIPT="$MY_DIR/lib/ansible_inventory.rb"

which $ANSIBLE_PLAYBOOK_BIN &> /dev/null
if [ $? -ne 0 ]; then
error "Could not find '$ANSIBLE_PLAYBOOK_BIN'"
warn "Please install Ansible according to http://www.ansibleworks.com/docs/intro_installation.html"
warn "and then re-run ${MYSELF}"
exit 1
fi

$ANSIBLE_PLAYBOOK_BIN -i $EXTERNAL_INVENTORY_SCRIPT "$@"

0 comments on commit 0372972

Please sign in to comment.