class apt {
exec { "apt-get-update":
command => "/usr/bin/apt-get update",
}
file { "/etc/apt/sources.list":
owner => "root",
group => "root",
mode => 0444,
ensure => "present",
content => template("apt/sources.list.erb"),
notify => Exec["apt-get-update"],
}
file { "/etc/apt/apt.conf":
owner => "root",
group => "root",
mode => 0444,
ensure => "present",
source => "puppet:///apt/apt.conf",
notify => Exec["apt-get-update"],
}
}
define apt::key($keyid) {
exec { "apt-key $keyid":
command => "/usr/bin/wget -q http://www.example.com/apt/keys/$keyid -O -|/usr/bin/apt-key add -",
unless => "/usr/bin/apt-key list|/bin/grep -c 458F2AD8",
}
}