]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Make custom_sources_list into a class paramter
authorGabriel Filion <gabster@lelutin.ca>
Sat, 27 Jul 2013 10:14:47 +0000 (06:14 -0400)
committerGabriel Filion <gabster@lelutin.ca>
Sat, 27 Jul 2013 10:14:47 +0000 (06:14 -0400)
and thus remove the last global variable.

README
manifests/init.pp

diff --git a/README b/README
index 35a88b25586a1da55e7d4399b50f56581b8f8253..90301be345f0add4d10ab4fefea6cbe2241b4d9a 100644 (file)
--- a/README
+++ b/README
@@ -113,22 +113,6 @@ the site_apt modules' files directory that is named the same as the
 host. (example: site_apt/files/some.host.com/03clean, or
 site_apt/files/some.host.com/03clean_vserver)
 
-Variables
-=========
-
-$custom_sources_list
---------------------
-
-By default this module will use a basic apt/sources.list template with
-a generic Debian mirror. If you need to set more specific sources,
-e.g. changing the sections included in the source, etc. you can set
-this variable to the content that you desire to use instead.
-
-For example, setting the following variable before including this class will
-pull in the templates/site_apt/sources.list file:
-
-  $custom_sources_list = template('site_apt/sources.list')
-
 Classes
 =======
 
@@ -214,6 +198,18 @@ Class parameters:
 
     class { 'apt': custom_preferences => false }
   
+* custom_sources_list
+
+  By default this module will use a basic apt/sources.list template with
+  a generic Debian mirror. If you need to set more specific sources,
+  e.g. changing the sections included in the source, etc. you can set
+  this variable to the content that you desire to use instead.
+
+  For example, setting this variable will pull in the
+  templates/site_apt/sources.list file:
+
+  class { 'apt': custom_sources_list => template('site_apt/sources.list') }
+
 * codename
 
   Contains the codename ("squeeze", "wheezy", ...) of the client's release. While
index 33eac370cb651ed5f462e1efd8a685b7d8ce13ef..7550aaa240cff916671ed8ca9c4ecf94d569d8ff 100644 (file)
@@ -15,6 +15,7 @@ class apt(
   $ubuntu_url = $apt::params::ubuntu_url,
   $repos = $apt::params::repos,
   $custom_preferences = $apt::params::custom_preferences,
+  $custom_sources_list = '',
   $disable_update = $apt::params::disable_update,
   $custom_key_dir = $apt::params::custom_key_dir
 ) inherits apt::params {
@@ -53,9 +54,9 @@ class apt(
   $next_codename = debian_nextcodename($codename)
   $next_release = debian_nextrelease($release)
 
-  $sources_content = $::custom_sources_list ? {
+  $sources_content = $custom_sources_list ? {
     ''      => template( "apt/${::operatingsystem}/sources.list.erb"),
-    default => $::custom_sources_list
+    default => $custom_sources_list
   }
   file {
     # include main, security and backports