Last active
August 29, 2015 14:06
-
-
Save torumakabe/57ae9f8edbe6cf30cd16 to your computer and use it in GitHub Desktop.
shell for a host of OpenStack tools
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
#!/bin/sh | |
ANSIBLE_PLAYBOOK=$1 | |
ANSIBLE_HOSTS=$2 | |
TEMP_HOSTS="/tmp/ansible_hosts" | |
if ! [ `which ansible` ]; then | |
apt-get install -y software-properties-common | |
apt-add-repository -y ppa:ansible/ansible | |
apt-get update | |
apt-get -y install ansible | |
fi | |
cp /vagrant/${ANSIBLE_HOSTS} ${TEMP_HOSTS} && chmod -x ${TEMP_HOSTS} | |
echo "Executing ansible ..." | |
bash -c "ansible-playbook /vagrant/${ANSIBLE_PLAYBOOK} --inventory-file=${TEMP_HOSTS} --connection=local" | |
rm ${TEMP_HOSTS} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment