summaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authorGabriel Filion <lelutin@gmail.com>2010-10-25 00:14:33 -0400
committerGabriel Filion <lelutin@gmail.com>2010-10-25 00:14:33 -0400
commitd97a49b7b2c020c2c43df6524236f50a421789ee (patch)
tree80702221488e6cbfe527a6d3a153708441d1e5bc /manifests/init.pp
parentac76a5d52df78aec919f08334ca5b140902a9298 (diff)
refactor: simplify and remove inline content
Simplifications: make apt_conf_snippet repeat less code, make code that generates sources.list more concise. Remove all inline content in favor of templates and static files. The ability to include sources for static files was needed for the main 'preferences' file, so it was added to the preferences_snippet define. Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp29
1 files changed, 11 insertions, 18 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 0e4bd5c..7d68303 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -19,23 +19,16 @@ class apt {
}
include lsb
- case $custom_sources_list {
- '': {
- config_file {
- # include main, security and backports
- # additional sources should be included via the custom_sources_template
- # define
- "/etc/apt/sources.list":
- content => template( "apt/$operatingsystem/sources.list.erb"),
- require => Package['lsb'];
- }
- }
- default: {
- config_file { "/etc/apt/sources.list":
- content => $custom_sources_list,
- require => Package['lsb'];
- }
- }
+ config_file {
+ # include main, security and backports
+ # additional sources should be included via the custom_sources_template
+ # define
+ "/etc/apt/sources.list":
+ content => $custom_sources_list ? {
+ '' => template( "apt/$operatingsystem/sources.list.erb"),
+ default => $custom_sources_list
+ },
+ require => Package['lsb'];
}
# 01autoremove already present by default
@@ -109,4 +102,4 @@ class apt {
# workaround for preseeded_package component
file { [ "/var/cache", "/var/cache/local", "/var/cache/local/preseeding" ]: ensure => directory }
-}
+}