summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README3
-rw-r--r--manifests/init.pp108
-rw-r--r--templates/sources.list.backports.erb8
-rw-r--r--templates/sources.list.erb6
4 files changed, 75 insertions, 50 deletions
diff --git a/README b/README
index c6e6c4e..8299c02 100644
--- a/README
+++ b/README
@@ -1,3 +1,6 @@
+forked from https://labs.riseup.net/code/projects/show/module-apt
+
+
Overview
========
diff --git a/manifests/init.pp b/manifests/init.pp
index 96ab2db..1af6e1f 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -11,6 +11,11 @@ class apt {
default => $apt_clean,
}
+ $backports_enabled = $backports_enabled ? {
+ '' => 'false',
+ default => $backports_enabled,
+ }
+
package { apt: ensure => installed }
# a few templates need lsbdistcodename
@@ -85,53 +90,68 @@ class apt {
# Another Semaphor for all packages to reference
alias => apt_updated;
}
+
+ ## This package should really always be current
+ package { "debian-archive-keyring":
+ ensure => latest,
+ }
- ## This package should really always be current
- package { "debian-archive-keyring":
- ensure => latest,
- }
-
- case $lsbdistcodename {
- etch: {
- package { "debian-backports-keyring":
- ensure => latest,
- }
-
- # This key was downloaded from
- # http://backports.org/debian/archive.key
- # and is needed to bootstrap the backports trustpath
- file { "${apt_base_dir}/backports.org.key":
- source => "puppet://$server/modules/apt/backports.org.key",
- mode => 0444, owner => root, group => root,
- }
- exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update":
- alias => "backports_key",
- refreshonly => true,
- subscribe => File["${apt_base_dir}/backports.org.key"],
- before => [ File[apt_config], Package["debian-backports-keyring"] ]
- }
- }
- lenny: {
- package { "debian-backports-keyring":
- ensure => latest,
- }
-
- # This key was downloaded from
- # http://backports.org/debian/archive.key
- # and is needed to bootstrap the backports trustpath
- file { "${apt_base_dir}/backports.org.key":
- source => "puppet://$server/modules/apt/backports.org.key",
- mode => 0444, owner => root, group => root,
- }
- exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update":
- alias => "backports_key",
- refreshonly => true,
- subscribe => File["${apt_base_dir}/backports.org.key"],
- before => [ File[apt_config], Package["debian-backports-keyring"] ]
- }
- }
+ case $backports_enabled {
+ 'true': {
+ config_file {
+ # backports
+ "/etc/apt/sources.list.d/debian-backports.list":
+ content => template("apt/sources.list.backports.erb"),
+ require => Exec[assert_lsbdistcodename];
+ }
+
+ case $lsbdistcodename {
+ etch: {
+ package { "debian-backports-keyring":
+ ensure => latest,
+ }
+
+ # This key was downloaded from
+ # http://backports.org/debian/archive.key
+ # and is needed to bootstrap the backports trustpath
+ file { "${apt_base_dir}/backports.org.key":
+ source => "puppet://$server/modules/apt/backports.org.key",
+ mode => 0444, owner => root, group => root,
+ }
+ exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update":
+ alias => "backports_key",
+ refreshonly => true,
+ subscribe => File["${apt_base_dir}/backports.org.key"],
+ before => [ File[apt_config], Package["debian-backports-keyring"] ]
+ }
+ }
+ lenny: {
+ package { "debian-backports-keyring":
+ ensure => latest,
+ }
+
+ # This key was downloaded from
+ # http://backports.org/debian/archive.key
+ # and is needed to bootstrap the backports trustpath
+ file { "${apt_base_dir}/backports.org.key":
+ source => "puppet://$server/modules/apt/backports.org.key",
+ mode => 0444, owner => root, group => root,
+ }
+ exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update":
+ alias => "backports_key",
+ refreshonly => true,
+ subscribe => File["${apt_base_dir}/backports.org.key"],
+ before => [ File[apt_config], Package["debian-backports-keyring"] ]
+ }
+ }
+ }
+
+ }
+ default: { }
}
+
+
case $custom_key_dir {
'': {
exec { "/bin/true # no_custom_keydir": }
diff --git a/templates/sources.list.backports.erb b/templates/sources.list.backports.erb
new file mode 100644
index 0000000..b62f6d3
--- /dev/null
+++ b/templates/sources.list.backports.erb
@@ -0,0 +1,8 @@
+# This file is brought to you by puppet
+
+# backports
+<% if (lsbdistcodename == "sid" || lsbdistcodename == "unstable") -%>
+# There are no backports for for <%= lsbdistcodename %>
+<% else -%>
+deb http://www.backports.org/debian/ <%= lsbdistcodename %>-backports main
+<% end -%>
diff --git a/templates/sources.list.erb b/templates/sources.list.erb
index 169d7b5..feb5603 100644
--- a/templates/sources.list.erb
+++ b/templates/sources.list.erb
@@ -9,9 +9,3 @@ deb http://ftp.debian.org/debian/ <%= lsbdistcodename %> main contrib non-free
deb http://security.debian.org/ <%= lsbdistcodename %>/updates main contrib non-free
<% end -%>
-# backports
-<% if (lsbdistcodename == "sid" || lsbdistcodename == "unstable") -%>
-# There are no backports for for <%= lsbdistcodename %>
-<% else -%>
-deb http://www.backports.org/debian/ <%= lsbdistcodename %>-backports main
-<% end -%>