Created
May 20, 2011 17:57
-
-
Save rcrowley/983420 to your computer and use it in GitHub Desktop.
Bootstrap a Puppet agent.
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
set -ex | |
apt-get install ruby rubygems || | |
yum install ruby rubygems || | |
pkgin install ruby rubygems || | |
false | |
gem install facter ${FACTER_VERSION:+"-v$FACTER_VERSION"} | |
gem install puppet ${PUPPET_VERSION:+"-v$PUPPET_VERSION"} | |
mkdir -p /etc/puppet /var/lib /var/log /var/run | |
cat >/etc/puppet/puppet.conf <<EOF | |
[main] | |
logdir = /var/log/puppet | |
rundir = /var/run/puppet | |
ssldir = \$vardir/ssl | |
vardir = /var/lib/puppet | |
pluginsync = true | |
server = ${SERVER:-"puppet"} | |
environment = ${ENVIRONMENT:-"production"} | |
EOF | |
export PATH="$PATH:/var/lib/gems/1.8/bin" | |
puppet agent --no-daemonize --onetime --no-splay --verbose || { | |
echo "On the Puppet master, run: puppet cert -s $(facter fqdn)" >&2 | |
read -p "Press <ENTER> when that's done. " ENTER | |
puppet agent --no-daemonize --onetime --no-splay --verbose | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment