summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-02-12 22:24:29 -0800
committerelijah <elijah@riseup.net>2015-02-12 22:24:29 -0800
commit721bf57600f9730a56f744150be34aa9e96457f8 (patch)
treec27530b35582b8333773973063ab3b62f5633d8c
parent64fb988c0e37d64fb3e241dc95f156072e43bf2a (diff)
pass custom_sources_list as a parameter instead of a global variable.
-rw-r--r--README32
-rw-r--r--manifests/init.pp10
2 files changed, 22 insertions, 20 deletions
diff --git a/README b/README
index 35a88b2..6b1bfcd 100644
--- a/README
+++ b/README
@@ -19,13 +19,13 @@ Ubuntu support is lagging behind but not absent either.
* the apt class has been moved to a paramterized class. if you were including
this class before, after passing some variables, you will need to move to
- instantiating the class with those variables instead. For example, if you
+ instantiating the class with those variables instead. For example, if you
had the following in your manifests:
$apt_debian_url = 'http://localhost:9999/debian/'
$apt_use_next_release = true
include apt
-
+
you will need to remove the variables, and the include and instead do
the following:
@@ -67,9 +67,9 @@ Ubuntu support is lagging behind but not absent either.
you will need to remove the variables, and the include and instead do the
following:
-
+
class { 'apt::listchanges': email => 'foo@example.com' }
-
+
* the apt::proxy_client class has been moved to a paramterized class. if you
were including this class before, after passing some variables, you will need
to move to instantiating the class with those variables instead. For example,
@@ -121,13 +121,13 @@ $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.
+(e.g. changing the sections included in the source, etc.) you can
+override the default by passing $custom_sources_list argument to apt
+class. For example:
-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')
+ class { 'apt':
+ custom_sources_list => template('site_apt/sources.list')
+ }
Classes
=======
@@ -188,10 +188,10 @@ Class parameters:
* disable_update
- Disable "apt-get update" which is normally triggered by apt::upgrade_package
- and apt::dist_upgrade.
+ Disable "apt-get update" which is normally triggered by apt::upgrade_package
+ and apt::dist_upgrade.
- Note that nodes can be updated once a day by using
+ Note that nodes can be updated once a day by using
APT::Periodic::Update-Package-Lists "1";
in i.e. /etc/apt/apt.conf.d/80_apt_update_daily.
@@ -213,7 +213,7 @@ Class parameters:
apt/preferences file to be absent:
class { 'apt': custom_preferences => false }
-
+
* codename
Contains the codename ("squeeze", "wheezy", ...) of the client's release. While
@@ -339,7 +339,7 @@ the following parameterized variables, which can be changed:
Example usage:
class { 'apt::listchanges': email => 'foo@example.com' }
-
+
apt::proxy_client
-----------------
@@ -432,7 +432,7 @@ following in your manifest:
apt::preseeded_package { locales: }
-You can also specify the content of the seed via the content parameter,
+You can also specify the content of the seed via the content parameter,
for example:
apt::preseeded_package { 'apticron':
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