Skip to content

Instantly share code, notes, and snippets.

@stbenjam
Created October 22, 2014 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stbenjam/18dea58b8d8be024b3a3 to your computer and use it in GitHub Desktop.
Save stbenjam/18dea58b8d8be024b3a3 to your computer and use it in GitHub Desktop.
#!/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
@stbenjam
Copy link
Author

  • You'll need to copy the puppet.conf to /etc/puppet/puppet.conf
  • Run puppet agent --test --waitforcert 30
  • On Foreman, go to 'Infrastructure / Smart Proxies' and click on the relevant proxy, select Certificates
  • Sign the puppet certificate

Alternatively, add something like *.example.com to /etc/puppet/autosign.conf on the smart proxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment