aboutsummaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authorGabriel Filion <lelutin@gmail.com>2010-10-18 01:43:24 -0400
committerGabriel Filion <lelutin@gmail.com>2010-10-18 01:43:24 -0400
commit973657848100d227c10f4b51a23bf24a56550c8d (patch)
tree107b223f3c181c78a31047ce7d6322080b1b89db /manifests/init.pp
parent8175bff077112fc7b1397f082f1fbac56474feb8 (diff)
downloadpuppet-apt-973657848100d227c10f4b51a23bf24a56550c8d.tar.gz
puppet-apt-973657848100d227c10f4b51a23bf24a56550c8d.tar.bz2
Remove unnecessary exec
When $custom_key_dir has not been assigned any value, a useless exec of /bin/true is run. Remove this by using 'if' instead of 'case'. Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp29
1 files changed, 12 insertions, 17 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 9ef1cea..57a685c 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -78,26 +78,21 @@ class apt {
package { "debian-archive-keyring": ensure => latest }
# backports uses the normal archive key now
package { "debian-backports-keyring": ensure => absent }
-
- case $custom_key_dir {
- '': {
- exec { "/bin/true # no_custom_keydir": }
+
+ if $custom_key_dir {
+ file { "${apt_base_dir}/keys.d":
+ source => "$custom_key_dir",
+ recurse => true,
+ mode => 0755, owner => root, group => root,
}
- default: {
- file { "${apt_base_dir}/keys.d":
- source => "$custom_key_dir",
- recurse => true,
- mode => 0755, owner => root, group => root,
- }
- exec { "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\; && apt-get update":
- alias => "custom_keys",
- subscribe => File["${apt_base_dir}/keys.d"],
- refreshonly => true,
- before => Config_file["apt_config"];
- }
+ exec { "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\; && apt-get update":
+ alias => "custom_keys",
+ subscribe => File["${apt_base_dir}/keys.d"],
+ refreshonly => true,
+ before => Config_file["apt_config"];
}
}
# workaround for preseeded_package component
file { [ "/var/cache", "/var/cache/local", "/var/cache/local/preseeding" ]: ensure => directory }
-}
+}