]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Make it possible to ensure preferences is absent
authorGabriel Filion <lelutin@gmail.com>
Mon, 18 Oct 2010 05:45:22 +0000 (01:45 -0400)
committerGabriel Filion <lelutin@gmail.com>
Mon, 18 Oct 2010 05:51:16 +0000 (01:51 -0400)
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>
README
manifests/init.pp

diff --git a/README b/README
index 131ae1d8299be01d89e45a5ec09adf36d611ca4e..dbcf3831ab04e777f2ca458c194f6a6087b3dd7e 100644 (file)
--- 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
index 57a685c3f6b7c6b0bc3c7678dbceba9a3f2176f9..60c95a11902dfe30b8c219af1a64f54ee5c2216d 100644 (file)
@@ -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,