Created
September 15, 2012 03:51
-
-
Save garthk/3726289 to your computer and use it in GitHub Desktop.
Use Puppet to ensure Ubuntu can get the latest Puppet
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
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, | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To quickly use: