Last active
June 14, 2016 16:23
-
-
Save steventwheeler/56b3d39505ea70ded9c7b2d4e1993cd9 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# Example Usage: | |
# curl -sSL https://gist.github.com/steventwheeler/56b3d39505ea70ded9c7b2d4e1993cd9/raw/bootstrap_puppet_agent_centos_6.sh | bash -s <PUPPET_MASTER_SERVER> | |
if [[ $EUID -ne 0 ]] ; then | |
echo "This script must be run as root." | |
exit 1 | |
fi | |
yum --assumeyes install http://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm | |
yum --assumeyes install puppet-agent ntp | |
if [ ! -z "$1" ] ; then | |
echo "PUPPET_SERVER=$1" > /etc/sysconfig/puppet | |
if [ -z "$(grep server /etc/puppetlabs/puppet/puppet.conf)" ] ; then | |
echo "[main]" >> /etc/puppetlabs/puppet/puppet.conf | |
echo "server = $1" >> /etc/puppetlabs/puppet/puppet.conf | |
fi | |
fi | |
chkconfig ntpd on | |
service ntpd start | |
/opt/puppetlabs/bin/puppet agent -t | |
chkconfig puppet on | |
service puppet start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment