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>
This commit is contained in:
Gabriel Filion 2010-10-18 01:45:22 -04:00
parent 9736578481
commit 4dbcd09281
2 changed files with 10 additions and 0 deletions

4
README
View file

@ -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

View 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,