aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Filion <lelutin@gmail.com>2010-10-18 01:45:22 -0400
committerGabriel Filion <lelutin@gmail.com>2010-10-18 01:51:16 -0400
commit4dbcd092817708292de6463777b331c8dbc7e727 (patch)
tree54c59888cf4045cd7c3c340b862c8448dc43c37a
parent973657848100d227c10f4b51a23bf24a56550c8d (diff)
downloadpuppet-apt-4dbcd092817708292de6463777b331c8dbc7e727.tar.gz
puppet-apt-4dbcd092817708292de6463777b331c8dbc7e727.tar.bz2
Make it possible to ensure preferences is absent
The current code makes it mandatory to have a file /etc/apt/preferences present. In the event that this file is empty or contains a space, apt-get update cannot execute. Add a case with the special value "false" that ensures the file does not exist. Signed-off-by: Gabriel Filion <lelutin@gmail.com>
-rw-r--r--README4
-rw-r--r--manifests/init.pp6
2 files changed, 10 insertions, 0 deletions
diff --git a/README b/README
index 131ae1d..dbcf383 100644
--- a/README
+++ b/README
@@ -62,6 +62,10 @@ example, setting the following variable before including this class
will pull in the templates/apt/preferences file:
$custom_preferences = 'template("apt/preferences")'
+Also, if you need the preferences file to be absent, set this variable to false:
+
+$custom_preferences = false
+
$custom_key_dir
---------------
If you have different apt-key files that you want to get added to your
diff --git a/manifests/init.pp b/manifests/init.pp
index 57a685c..60c95a1 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -40,6 +40,12 @@ class apt {
'': {
include apt::default_preferences
}
+ false: {
+ config_file { "/etc/apt/preferences":
+ alias => "apt_config",
+ ensure => absent;
+ }
+ }
default: {
config_file { "/etc/apt/preferences":
content => $custom_preferences,