Skip to content

Instantly share code, notes, and snippets.

@frgaudet
Last active December 4, 2020 15:13
Show Gist options
  • Save frgaudet/9b09f521eecbde95dd59 to your computer and use it in GitHub Desktop.
Save frgaudet/9b09f521eecbde95dd59 to your computer and use it in GitHub Desktop.
Install puppet agent on a running computer/VM
SERVER=foreman
cat > /etc/apt/sources.list.d/puppetlabs.list << EOF
deb http://apt.puppetlabs.com trusty main
deb-src http://apt.puppetlabs.com trusty main
deb http://apt.puppetlabs.com trusty dependencies
deb-src http://apt.puppetlabs.com trusty main dependencies
EOF
apt-get update
apt-get install -y --force-yes puppet
if [ -e /etc/default/puppet ]; then
sed -i "s/START=no/START=yes/" /etc/default/puppet
fi
cat >> /etc/puppet/puppet.conf << EOF
[agent]
server=$SERVER
runinterval=180
EOF
puppet agent --enable
service puppet restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment