require => Package['molly-guard'],
}
+ file { '/etc/apt/trusted-keys.d':
+ ensure => absent,
+ }
+ file { '/etc/apt/trusted.gpg',
+ mode => '0600',
+ content => "",
+ }
site::aptrepo { 'security':
url => 'http://security.debian.org/',
suite => "${::lsbdistcodename}/updates",
suite => "${::lsbdistcodename}-backports",
components => ['main','contrib','non-free']
}
- site::aptrepo { 'backports.org':
- ensure => absent,
- keyid => '16BA136C',
- key => 'puppet:///modules/debian-org/backports.org.asc',
- }
site::aptrepo { 'volatile':
url => $mirror,
$suite='',
$components=[],
$key = undef,
- $keyid = undef,
$ensure = present
) {
case $ensure {
present: {
if $key {
- exec { "apt-key-update-${name}":
- command => "apt-key add /etc/apt/trusted-keys.d/${name}.asc",
- refreshonly => true,
- }
-
- file { "/etc/apt/trusted-keys.d/${name}.asc":
+ file { "/etc/apt/trusted.gpg.d/${name}.gpg":
source => $key,
mode => '0664',
- notify => Exec["apt-key-update-${name}"]
}
}
}
absent: {
- if ($keyid) and ($key) {
- file { "/etc/apt/trusted-keys.d/${name}.asc":
- ensure => absent,
- notify => Exec["apt-key-del-${keyid}"]
- }
- exec { "apt-key-del-${keyid}":
- command => "apt-key del ${keyid}",
- refreshonly => true,
- }
- } elsif $key {
- file { "/etc/apt/trusted-keys.d/${name}.asc":
+ if $key {
+ file { "/etc/apt/trusted.gpg.d/${name}.gpg":
ensure => absent,
}
- } elsif $keyid {
- exec { "apt-key-del-${keyid}":
- command => "apt-key del ${keyid}",
- }
}
}
default: { fail ( "Unknown ensure value: '$ensure'" ) }