Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Use Puppet to ensure Ubuntu can get the latest Puppet
class puppetlabs {
# Install Puppet repository and call apt-get update
case $operatingsystem {
ubuntu: {
$key = "4BD6EC30"
exec { 'apt-key puppetlabs':
path => "/bin:/usr/bin",
unless => "apt-key list | grep '${key}' | grep -v expired",
command => "apt-key adv --keyserver --recv-keys ${key}",
file { 'apt source puppetlabs':
ensure => present,
path => "/etc/apt/sources.list.d/puppetlabs.list",
content => "deb ${lsbdistcodename} main\n",
file { 'old puppet list':
path => "/etc/apt/sources.list.d/puppet.list",
ensure => absent,
exec { 'apt-get update puppetlabs':
command => "/usr/bin/apt-get update",
require => [Exec['apt-key puppetlabs'], File['apt source puppetlabs']],
creates => "/var/lib/apt/lists/apt.puppetlabs.com_dists_${lsbdistcodename}_main_binary-${architecture}_Packages",
timeout => 3600,

This comment has been minimized.

Copy link
Owner Author

commented Oct 23, 2012

To quickly use:

curl -O ; sudo puppet apply -e 'include puppetlabs'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.