Merge branch 'master' of buse.riseup.net:shared-apt

This commit is contained in:
Micah Anderson 2014-03-21 12:04:25 -04:00
commit 51b69c2661
6 changed files with 19 additions and 44 deletions

37
README
View file

@ -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

View file

@ -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"

View file

@ -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 ''

View 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

View file

@ -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 {

View file

@ -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 -%>