summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/init.pp6
-rw-r--r--manifests/preferences/absent.pp5
-rw-r--r--manifests/preferences_snippet.pp4
-rw-r--r--manifests/unattended_upgrades.pp8
4 files changed, 16 insertions, 7 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 8588932..dde9c29 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -96,7 +96,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/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],
+ }
+ }
}