Created
October 22, 2014 16:37
-
-
Save stbenjam/18dea58b8d8be024b3a3 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 | |
usage() { | |
cat <<EOF | |
Usage: $0 <puppet server> | |
EOF | |
exit 1 | |
} | |
die() { echo "$@" 1>&2; exit 1; } | |
[ ! -z $1 ] || usage | |
[ ! -z $(hostname -f) ] || (echo "hostname -f does not return a valid hostname" && usage) | |
PUPPET_SERVER=$1 | |
echo "Installing puppet..." | |
rpm -q puppet || yum -y install puppet | |
cat <<EOF > puppet.conf | |
[main] | |
vardir = /var/lib/puppet | |
logdir = /var/log/puppet | |
rundir = /var/run/puppet | |
ssldir = \$vardir/ssl | |
[agent] | |
pluginsync = true | |
report = true | |
ignoreschedules = true | |
daemon = false | |
ca_server = $PUPPET_SERVER | |
certname = $(hostname -f) | |
server = $PUPPET_SERVER | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
puppet agent --test --waitforcert 30
Alternatively, add something like
*.example.com
to /etc/puppet/autosign.conf on the smart proxy