aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp58
-rw-r--r--manifests/preferences.pp11
-rw-r--r--manifests/preferences/absent.pp8
-rw-r--r--manifests/proxy-client.pp18
4 files changed, 49 insertions, 46 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 675c78d..4db120d 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -29,7 +29,21 @@ class apt {
}
}
- include apt::preferences
+ config_file {
+ # little default settings which keep the system sane
+ "/etc/apt/apt.conf.d/from_puppet":
+ content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n",
+ before => Concatenated_file['/etc/apt/preferences'];
+ }
+
+ case $custom_preferences {
+ false: {
+ include apt::preferences::absent
+ }
+ default: {
+ include apt::preferences
+ }
+ }
if $apt_unattended_upgrades {
include apt::unattended_upgrades
@@ -55,48 +69,14 @@ class apt {
'/etc/apt/preferences'],
loglevel => info,
# Another Semaphor for all packages to reference
- alias => apt_updated;
+ alias => "apt_updated";
}
## 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:///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 => [ Concatenated_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:///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 => [ Concatenated_file[apt_config], Package["debian-backports-keyring"] ]
- }
- }
- }
+ # backports uses the normal archive key now
+ package { "debian-backports-keyring": ensure => absent }
if $custom_key_dir {
file { "${apt_base_dir}/keys.d":
@@ -114,4 +94,4 @@ class apt {
# workaround for preseeded_package component
file { [ "/var/cache", "/var/cache/local", "/var/cache/local/preseeding" ]: ensure => directory }
-}
+}
diff --git a/manifests/preferences.pp b/manifests/preferences.pp
index 232b8f7..772b426 100644
--- a/manifests/preferences.pp
+++ b/manifests/preferences.pp
@@ -4,7 +4,8 @@ class apt::preferences {
$apt_preferences_dir = "${common::moduledir::module_dir_path}/apt/preferences"
module_dir{'apt/preferences': }
file{"${apt_preferences_dir}_header":
- content => 'Package: *
+ content => $custom_preferences ? {
+ '' => 'Package: *
Pin: release a=unstable
Pin-Priority: 1
@@ -13,6 +14,8 @@ Pin: release a=testing
Pin-Priority: 2
',
+ default => $custom_preferences
+ },
}
concatenated_file{'/etc/apt/preferences':
@@ -25,10 +28,4 @@ Pin-Priority: 2
require => File["/etc/apt/sources.list"];
}
- config_file {
- # little default settings which keep the system sane
- "/etc/apt/apt.conf.d/from_puppet":
- content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n",
- before => Concatenated_file[apt_config];
- }
}
diff --git a/manifests/preferences/absent.pp b/manifests/preferences/absent.pp
new file mode 100644
index 0000000..3131aff
--- /dev/null
+++ b/manifests/preferences/absent.pp
@@ -0,0 +1,8 @@
+class apt::preferences::absent {
+ include common::moduledir
+ $apt_preferences_dir = "${common::moduledir::module_dir_path}/apt/preferences"
+ concatenated_file{'/etc/apt/preferences':
+ dir => $apt_preferences_dir,
+ ensure => absent,
+ }
+}
diff --git a/manifests/proxy-client.pp b/manifests/proxy-client.pp
new file mode 100644
index 0000000..ea0a29c
--- /dev/null
+++ b/manifests/proxy-client.pp
@@ -0,0 +1,18 @@
+class apt::proxy-client {
+
+ $real_apt_proxy = $apt_proxy ? {
+ "" => "localhost",
+ default => $apt_proxy
+ }
+
+ $real_apt_proxy_port = $apt_proxy_port ? {
+ "" => "3142",
+ default => $apt_proxy_port
+ }
+
+ file { "/etc/apt/apt.conf.d/20proxy":
+ ensure => present,
+ content => "Acquire::http { Proxy \"http://$real_apt_proxy:$real_apt_proxy_port\"; };\n",
+ owner => root, group => 0, mode => 0644;
+ }
+}