From 4ebb7d463ed6e85a715f0a311378bf673a907042 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Mon, 25 Oct 2010 12:17:50 -0400 Subject: Fix apt::preferences::absent Currently, setting the $custom_preferences variable to false fails because of the /etc/apt/preferences concatenated_file being re-defined. Fix this by setting dependencies on the resource only when we expect to create the /etc/apt/preferences file. Also, since there is no "ensure" parameter to concatenated_file, use a simple file resource to ensure that it is removed. Signed-off-by: Gabriel Filion --- manifests/unattended_upgrades.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'manifests/unattended_upgrades.pp') 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], + } + } } -- cgit v1.2.3