puppet-standalone-mashup/shared/modules/debsource/manifests/init.pp
2012-06-22 22:02:08 -04:00

24 lines
681 B
Puppet

define debsource($apt_source, $keyfile = '', $host = '', $hash = '') {
$file = "/etc/apt/sources.list.d/${name}.list"
file { $file: content => $apt_source }
if ($host != '') {
exec { "debsource-${name}":
command => "apt-key adv --keyserver ${host} --recv ${hash} && apt-get update",
unless => "test $(apt-key list | grep ${hash} | wc -l) -ne 0",
path => $base::path,
require => File[$file]
}
}
if ($keyfile != '') {
exec { "debsource-${name}":
command => "curl $keyfile | apt-key add -",
path => $base::path,
require => File[$file],
unless => "test $(apt-key list | grep ${hash} | wc -l) -ne 0"
}
}
}