From c99227ad55e8d266a77ad5dfb672147eec6e1c3b Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Sat, 27 Jul 2013 06:14:47 -0400 Subject: Make custom_sources_list into a class paramter and thus remove the last global variable. --- README | 28 ++++++++++++---------------- manifests/init.pp | 5 +++-- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/README b/README index 35a88b2..90301be 100644 --- 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 diff --git a/manifests/init.pp b/manifests/init.pp index 33eac37..7550aaa 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 -- cgit v1.2.3 From f8aa2ef8722592b61fcbc10959c571ff19dee573 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 8 Dec 2013 21:58:20 +0000 Subject: Drop Debian Etch and Lenny compatibility. Both have been unsupported for ages. --- README | 5 ++--- lib/puppet/parser/functions/debian_nextcodename.rb | 2 -- lib/puppet/parser/functions/debian_release_version.rb | 2 -- templates/Debian/sources.list.erb | 14 -------------- 4 files changed, 2 insertions(+), 21 deletions(-) diff --git a/README b/README index 90301be..b241739 100644 --- a/README +++ b/README @@ -130,9 +130,8 @@ Class parameters: * use_volatile - If this variable is set to true the Debian Volatile sources (until - Lenny) or CODENAME-updates (such as squeeze-updates, supported since - Squeeze) are added. + If this variable is set to true the CODENAME-updates sources (such as + squeeze-updates) are added. By default this is false for backward compatibility with older versions of this module. diff --git a/lib/puppet/parser/functions/debian_nextcodename.rb b/lib/puppet/parser/functions/debian_nextcodename.rb index 3d5c3bd..f3190ef 100644 --- a/lib/puppet/parser/functions/debian_nextcodename.rb +++ b/lib/puppet/parser/functions/debian_nextcodename.rb @@ -1,8 +1,6 @@ module Puppet::Parser::Functions newfunction(:debian_nextcodename, :type => :rvalue) do |args| case args[0] - when "etch" then "lenny" - when "lenny" then "squeeze" when "squeeze" then "wheezy" when "wheezy" then "jessie" when "jessie" then "sid" diff --git a/lib/puppet/parser/functions/debian_release_version.rb b/lib/puppet/parser/functions/debian_release_version.rb index 0abe90e..0a57fd3 100644 --- a/lib/puppet/parser/functions/debian_release_version.rb +++ b/lib/puppet/parser/functions/debian_release_version.rb @@ -1,8 +1,6 @@ module Puppet::Parser::Functions newfunction(:debian_release_version, :type => :rvalue) do |args| case args[0] - when 'etch' then '4.0' - when 'lenny' then '5.0' when 'squeeze' then '6.0' when 'wheezy' then '7.0' else '' diff --git a/templates/Debian/sources.list.erb b/templates/Debian/sources.list.erb index 49cf38c..65b5945 100644 --- a/templates/Debian/sources.list.erb +++ b/templates/Debian/sources.list.erb @@ -34,19 +34,12 @@ deb-src <%= backports_url %> <%= codename %>-backports <%= lrepos %> <% if (release == "testing" || release == "unstable" || release == "experimental") -%> # There is no volatile archive for <%= release %> <% else -%> -<% if (codename == "lenny" || codename == "etch") -%> -deb <%= volatile_url=scope.lookupvar('apt::volatile_url') %> <%= codename %>/volatile <%= lrepos %> -<% if include_src -%> -deb-src <%= volatile_url %> <%= codename %>/volatile <%= lrepos %> -<% end -%> -<% else -%> deb <%= debian_url %> <%= codename %>-updates <%= lrepos %> <% if include_src -%> deb-src <%= debian_url %> <%= codename %>-updates <%= lrepos %> <% end -%> <% end -%> <% end -%> -<% end -%> <% if next_release=scope.lookupvar('apt::use_next_release') -%> ### Debian next: <%= next_release=scope.lookupvar('apt::next_release') ; next_codename=scope.lookupvar('apt::next_codename') %> @@ -72,12 +65,6 @@ deb-src <%= security_url %> <%= next_codename %>/updates <%= lrepos %> <% if (next_release == "testing" || next_release == "unstable" || next_release == "experimental") -%> # There is no volatile archive for <%= next_release %> <% else -%> -<% if (next_codename == "lenny" || next_codename == "etch") -%> -deb <%= volatile_url %> <%= next_codename %>/volatile <%= lrepos %> -<% if include_src then -%> -deb-src <%= volatile_url %> <%= next_codename %>/volatile <%= lrepos %> -<% end -%> -<% else -%> deb <%= debian_url %> <%= next_codename %>-updates <%= lrepos %> <% if include_src then -%> deb-src <%= debian_url %> <%= next_codename %>-updates <%= lrepos %> @@ -85,4 +72,3 @@ deb-src <%= debian_url %> <%= next_codename %>-updates <%= lrepos %> <% end -%> <% end -%> <% end -%> -<% end -%> -- cgit v1.2.3 From f286b0ed860660ce255740f2f43123d024553bcc Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 8 Dec 2013 21:58:38 +0000 Subject: Remove Lenny-related comment that was made obsolete a year ago by commit 822950. --- manifests/preferences_snippet.pp | 3 --- 1 file changed, 3 deletions(-) diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp index cbc83d2..0c7b7bb 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -34,9 +34,6 @@ define apt::preferences_snippet ( owner => root, group => 0, mode => '0644'; } - # This should really work in the same manner as sources_list and apt_conf - # snippets, but since the preferences.d directory cannot be used in Debian - # lenny, we can't generalize without going into ugly special-casing. case $source { '': { case $release { -- cgit v1.2.3 From 128410f64363f717fc0d5a13faf769843a0b733c Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 8 Dec 2013 22:00:22 +0000 Subject: Adapt documentation to take into account we haven't been supporting Lenny for more than a year. --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index b241739..0057d87 100644 --- a/README +++ b/README @@ -180,8 +180,8 @@ Class parameters: * custom_preferences - Since Debian Lenny's version of APT doesn't support the use of the - preferences.d directory for putting fragments of 'preferences', this + For historical reasons (Debian Lenny's version of APT did not support the use + of the preferences.d directory for putting fragments of 'preferences'), this module will manage a default generic apt/preferences file with more recent releases pinned to very low values so that any package installation will not accidentally pull in packages from those suites -- cgit v1.2.3