From 721bf57600f9730a56f744150be34aa9e96457f8 Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 12 Feb 2015 22:24:29 -0800 Subject: pass custom_sources_list as a parameter instead of a global variable. --- manifests/init.pp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 33eac37..21e546f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -16,7 +16,8 @@ class apt( $repos = $apt::params::repos, $custom_preferences = $apt::params::custom_preferences, $disable_update = $apt::params::disable_update, - $custom_key_dir = $apt::params::custom_key_dir + $custom_key_dir = $apt::params::custom_key_dir, + $custom_sources_list = undef ) inherits apt::params { case $::operatingsystem { 'debian': { @@ -53,9 +54,10 @@ class apt( $next_codename = debian_nextcodename($codename) $next_release = debian_nextrelease($release) - $sources_content = $::custom_sources_list ? { - '' => template( "apt/${::operatingsystem}/sources.list.erb"), - default => $::custom_sources_list + if $custom_sources_list == undef { + $sources_content = template( "apt/${::operatingsystem}/sources.list.erb") + } else { + $sources_content = $custom_sources_list } file { # include main, security and backports -- cgit v1.2.3