Created
July 14, 2014 09:48
-
-
Save zipkid/314b1de69e3f28e222a1 to your computer and use it in GitHub Desktop.
Shell provisioner use in Vagrant
This file contains hidden or 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/bash | |
#set -x | |
PROXY='' | |
RELEASE='6-10' | |
if [ "X-${PROXY}" != 'X-' ] | |
then | |
export http_proxy=${PROXY} | |
export https_proxy=${PROXY} | |
grep 'proxy=' /etc/yum.conf | |
RETVAL_GREP=$? | |
if [ $RETVAL_GREP -ne 0 ] | |
then | |
grep -v 'proxy=' /etc/yum.conf > /tmp/yum.conf | |
mv /tmp/yum.conf /etc/yum.conf | |
echo "proxy=${PROXY}" >> /etc/yum.conf | |
fi | |
else | |
unset http_proxy | |
unset https_proxy | |
grep -v 'proxy=' /etc/yum.conf > /tmp/yum.conf | |
mv /tmp/yum.conf /etc/yum.conf | |
fi | |
#yum clean all | |
sudo yum -y install wget | |
echo I am provisioning puppet onto this VM | |
if [ ! -f puppetlabs-release-${RELEASE}.noarch.rpm ] | |
then | |
wget http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-${RELEASE}.noarch.rpm | |
fi | |
rpm -q puppetlabs-release | |
RETVAL_REPO=$? | |
if [ $RETVAL_REPO -ne 0 ] | |
then | |
sudo rpm -ivh puppetlabs-release-${RELEASE}.noarch.rpm | |
fi | |
rpm -q puppet | |
RETVAL_RPM=$? | |
if [ $RETVAL_RPM -ne 0 ] | |
then | |
sudo yum -y install puppet | |
fi | |
# force update of puppet to latest version | |
sudo yum -y install puppet |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
config.vm.define :puppet do |vm_config|' | |
vm_config.vm.provider :digital_ocean do |provider, override| | |
# stuff for DO | |
end | |
vm_config.vm.provision :shell, :path => "setup.sh" | |
vm_config.vm.provision :puppet do |puppet| | |
puppet.manifests_path = "./manifests" | |
puppet.manifest_file = "puppet.pp" | |
puppet.options = "--verbose --debug" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment