Skip to content

Instantly share code, notes, and snippets.

Embed
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 keyserver.ubuntu.com --recv-keys ${key}",
}
file { 'apt source puppetlabs':
ensure => present,
path => "/etc/apt/sources.list.d/puppetlabs.list",
content => "deb http://apt.puppetlabs.com ${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,
}
}
}
}
@garthk

This comment has been minimized.

Copy link
Owner Author

commented Oct 23, 2012

To quickly use:

curl -O https://raw.github.com/gist/3726289/b6a10fd055eb9ea20f1c30d27e6d3f69fb1fa493/puppetlabs.pp ; 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.