summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2010-11-21 16:50:43 +0100
committerintrigeri <intrigeri@boum.org>2010-11-21 16:50:43 +0100
commit3de76e7b05224b9696a75908b0a4259349e20823 (patch)
tree428799424b34d7911e6dd39a0ab2ef94c7900525
parentf25a8a91099d6c1ef512a5fb21581abc62e1519a (diff)
parent92aa5a51e95d74604a40318558aa98f70fcf7720 (diff)
Merge commit '92aa5a51e95d74604a40318558aa98f70fcf7720'.
A bunch of painlessly merged commits. Conflicts: manifests/init.pp
-rw-r--r--manifests/init.pp19
-rw-r--r--manifests/preferences/absent.pp5
-rw-r--r--manifests/preferences_snippet.pp4
-rw-r--r--manifests/proxy_client.pp2
-rw-r--r--manifests/sources_list.pp1
-rw-r--r--manifests/unattended_upgrades.pp8
-rw-r--r--templates/20proxy.erb2
7 files changed, 26 insertions, 15 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 54b4fe4..c48cb6e 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -104,6 +104,8 @@ class apt {
include apt::preferences::absent
}
default: {
+ # When squeeze becomes the stable branch, transform this file's header
+ # into a preferences.d file
include apt::preferences
}
}
@@ -119,12 +121,13 @@ class apt {
],
}
- if $apt_unattended_upgrades {
- include apt::unattended_upgrades
- }
-
- # watch apt.conf.d
+ # watch .d directories and ensure they are present
file { "/etc/apt/apt.conf.d": ensure => directory, checksum => mtime; }
+ file { "/etc/apt/sources.list.d":
+ ensure => directory,
+ checksum => mtime,
+ notify => Exec['refresh_apt'],
+ }
exec {
# "&& sleep 1" is workaround for older(?) clients
@@ -164,7 +167,11 @@ class apt {
alias => "custom_keys",
subscribe => File["${apt_base_dir}/keys.d"],
refreshonly => true,
- before => Concatenated_file[apt_config];
+ }
+ if $custom_preferences != false {
+ Exec["custom_keys"] {
+ before => Concatenated_file[apt_config],
+ }
}
}
diff --git a/manifests/preferences/absent.pp b/manifests/preferences/absent.pp
index 3131aff..d8b2e10 100644
--- a/manifests/preferences/absent.pp
+++ b/manifests/preferences/absent.pp
@@ -1,8 +1,5 @@
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,
+ file {'/etc/apt/preferences':
ensure => absent,
}
}
diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp
index a723206..9da7a8e 100644
--- a/manifests/preferences_snippet.pp
+++ b/manifests/preferences_snippet.pp
@@ -4,6 +4,10 @@ define apt::preferences_snippet(
$release,
$priority
){
+ if $custom_preferences == false {
+ fail("Trying to define a preferences_snippet with \$custom_preferences set to false.")
+ }
+
include apt::preferences
file { "${apt::preferences::apt_preferences_dir}/${name}":
diff --git a/manifests/proxy_client.pp b/manifests/proxy_client.pp
index 9883933..23e9bd1 100644
--- a/manifests/proxy_client.pp
+++ b/manifests/proxy_client.pp
@@ -1,7 +1,7 @@
class apt::proxy_client {
$real_apt_proxy = $apt_proxy ? {
- "" => "localhost",
+ "" => "http://localhost",
default => $apt_proxy
}
diff --git a/manifests/sources_list.pp b/manifests/sources_list.pp
index d3f18d5..bbf887a 100644
--- a/manifests/sources_list.pp
+++ b/manifests/sources_list.pp
@@ -12,7 +12,6 @@ define apt::sources_list (
file { "/etc/apt/sources.list.d/${name}":
ensure => $ensure,
- notify => Exec['refresh_apt'],
owner => root, group => 0, mode => 0600;
}
diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp
index fb04193..f52448d 100644
--- a/manifests/unattended_upgrades.pp
+++ b/manifests/unattended_upgrades.pp
@@ -7,8 +7,12 @@ class apt::unattended_upgrades {
apt_conf { "50unattended-upgrades":
source => ["puppet:///modules/site-apt/50unattended-upgrades",
"puppet:///modules/apt/50unattended-upgrades" ],
-
- before => Concatenated_file[apt_config],
require => Package['unattended-upgrades'],
}
+
+ if $custom_preferences != false {
+ Apt_conf["50unattended-upgrades"] {
+ before => Concatenated_file[apt_config],
+ }
+ }
}
diff --git a/templates/20proxy.erb b/templates/20proxy.erb
index 36b26a0..8f57e73 100644
--- a/templates/20proxy.erb
+++ b/templates/20proxy.erb
@@ -1,4 +1,4 @@
# This file is brought to you by Puppet
# all local modifications will be overwritten
-Acquire::http { Proxy "http://<%= real_apt_proxy %>:<%= real_apt_proxy_port %>"; };
+Acquire::http { Proxy "<%= real_apt_proxy %>:<%= real_apt_proxy_port %>"; };