diff options
author | Micah Anderson <micah@riseup.net> | 2014-03-21 12:04:25 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2014-03-21 12:04:25 -0400 |
commit | 51b69c26619e0bde9a0a67dba7fdae2ca2526363 (patch) | |
tree | 83304a7df42b024889042ad5a2297cfc2b226bc8 | |
parent | 082a2f77687b5c9dad63f5b30c672cc495506cd9 (diff) | |
parent | 128410f64363f717fc0d5a13faf769843a0b733c (diff) | |
download | puppet-apt-51b69c26619e0bde9a0a67dba7fdae2ca2526363.tar.gz puppet-apt-51b69c26619e0bde9a0a67dba7fdae2ca2526363.tar.bz2 |
Merge branch 'master' of buse.riseup.net:shared-apt
-rw-r--r-- | README | 37 | ||||
-rw-r--r-- | lib/puppet/parser/functions/debian_nextcodename.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/functions/debian_release_version.rb | 2 | ||||
-rw-r--r-- | manifests/init.pp | 5 | ||||
-rw-r--r-- | manifests/preferences_snippet.pp | 3 | ||||
-rw-r--r-- | templates/Debian/sources.list.erb | 14 |
6 files changed, 19 insertions, 44 deletions
@@ -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 ======= @@ -146,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. @@ -197,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 @@ -214,6 +197,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/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/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 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 { 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 -%> |