Created
March 13, 2014 14:50
-
-
Save zipkid/9529900 to your computer and use it in GitHub Desktop.
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 | |
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
vm_config.vm.provision :shell, :path => "setup.sh" | |
vm_config.vm.provision :puppet do |puppet| | |
puppet.manifests_path = "../manifests" | |
puppet.manifest_file = "init.pp" | |
puppet.module_path = "../../../modules" | |
puppet.options = "--verbose --debug" | |
puppet.facter = { | |
'fqdn' => fqdn, | |
'ipaddr' => ipaddr, | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment