site::aptrepo { 'security':
template => 'debian-org/etc/apt/sources.list.d/security.list.erb',
}
- site::aptrepo { 'backports.org':
- template => 'debian-org/etc/apt/sources.list.d/backports.org.list.erb',
+ site::aptrepo { 'backports.debian.org':
+ template => 'debian-org/etc/apt/sources.list.d/backports.debian.org.list.erb',
}
site::aptrepo { 'volatile':
template => 'debian-org/etc/apt/sources.list.d/volatile.list.erb',
}
}
+ site::aptrepo { 'backports.org':
+ ensure => absent,
+ keyid => '16BA136C',
+ key => 'puppet:///modules/debian-org/backports.org.asc',
+ }
site::aptrepo { 'debian.org':
ensure => absent,
--- /dev/null
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+<% if lsbdistcodename == 'lenny' %>
+deb http://archive.debian.org/debian-backports/ lenny-backports main contrib non-free
+<% elsif lsbdistcodename != 'n/a' %>
+deb http://backports.debian.org/debian-backports/ <%= lsbdistcodename %>-backports main contrib non-free
+<% end %>
+++ /dev/null
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-<% if lsbdistcodename == 'lenny' %>
-deb http://archive.debian.org/debian-backports/ lenny-backports main contrib non-free
-<% elsif lsbdistcodename != 'n/a' %>
-deb http://backports.debian.org/debian-backports/ <%= lsbdistcodename %>-backports main contrib non-free
-<% end %>
-define site::aptrepo ($key = undef, $template = undef, $config = undef, $ensure = present) {
+define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config = undef, $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":
- source => $key,
- mode => '0664',
- notify => Exec["apt-key-update-${name}"]
- }
- }
case $ensure {
- present: {}
- absent: {}
+ 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":
+ 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":
+ ensure => absent,
+ }
+ } elsif $keyid {
+ exec { "apt-key-del-${keyid}":
+ command => "apt-key del ${keyid}",
+ }
+ }
+ }
default: { fail ( "Unknown ensure value: '$ensure'" ) }
}