This repository was archived by the owner on Mar 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael G. Noll
committed
Jun 24, 2014
1 parent
d86fcab
commit 0372972
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" |