Merge branch 'master' into leap

This commit is contained in:
Micah Anderson 2013-05-26 17:04:05 -04:00
commit 61a2f48948
6 changed files with 52 additions and 27 deletions

View file

@ -4,7 +4,8 @@ module Puppet::Parser::Functions
when "etch" then "lenny"
when "lenny" then "squeeze"
when "squeeze" then "wheezy"
when "wheezy" then "sid"
when "wheezy" then "jessie"
when "jessie" then "sid"
when "sid" then "experimental"
else "sid"
end

View file

@ -1,9 +1,9 @@
module Puppet::Parser::Functions
newfunction(:debian_release, :type => :rvalue) do |args|
case args[0]
when 'lenny' then 'oldstable'
when 'squeeze' then 'stable'
when 'wheezy' then 'testing'
when 'squeeze' then 'oldstable'
when 'wheezy' then 'stable'
when 'jessie' then 'testing'
when 'sid' then 'unstable'
when 'experimental' then 'experimental'
else 'testing'

View file

@ -4,6 +4,7 @@ module Puppet::Parser::Functions
when 'etch' then '4.0'
when 'lenny' then '5.0'
when 'squeeze' then '6.0'
when 'wheezy' then '7.0'
else ''
end
end

View file

@ -4,19 +4,19 @@
# See LICENSE for the full license granted to you.
class apt(
$codename = $::lsbdistcodename,
$use_volatile = false,
$include_src = false,
$use_next_release = false,
$debian_url = 'http://http.debian.net/debian/',
$security_url = 'http://security.debian.org/',
$backports_url = 'http://backports.debian.org/debian-backports/',
$volatile_url = 'http://volatile.debian.org/debian-volatile/',
$ubuntu_url = 'http://archive.ubuntu.com/ubuntu',
$repos = 'auto',
$custom_preferences = '',
$disable_update = false
){
$codename = $apt::params::codename,
$use_volatile = $apt::params::use_volatile,
$include_src = $apt::params::include_src,
$use_next_release = $apt::params::use_next_release,
$debian_url = $apt::params::debian_url,
$security_url = $apt::params::security_url,
$backports_url = $apt::params::backports_url,
$volatile_url = $apt::params::volatile_url,
$ubuntu_url = $apt::params::ubuntu_url,
$repos = $apt::params::repos,
$custom_preferences = $apt::params::custom_preferences,
$disable_update = $apt::params::disable_update
) inherits apt::params {
case $::operatingsystem {
'debian': {
$real_repos = $repos ? {
@ -26,7 +26,7 @@ class apt(
}
'ubuntu': {
$real_repos = $repos ? {
'' => 'main restricted universe multiverse',
'auto' => 'main restricted universe multiverse',
default => $repos,
}
}

17
manifests/params.pp Normal file
View file

@ -0,0 +1,17 @@
class apt::params () {
$codename = $::lsbdistcodename
$use_volatile = false
$include_src = false
$use_next_release = false
$debian_url = 'http://http.debian.net/debian/'
$security_url = 'http://security.debian.org/'
$backports_url = $::lsbdistcodename ? {
'wheezy' => $debian_url,
default => 'http://backports.debian.org/debian-backports/',
}
$volatile_url = 'http://volatile.debian.org/debian-volatile/'
$ubuntu_url = 'http://archive.ubuntu.com/ubuntu'
$repos = 'auto'
$custom_preferences = ''
$disable_update = false
}

View file

@ -1,5 +1,5 @@
define apt::preferences_snippet (
$priority,
$priority = undef,
$package = false,
$ensure = 'present',
$source = '',
@ -12,15 +12,21 @@ define apt::preferences_snippet (
default => $package,
}
if $custom_preferences == false {
fail('Trying to define a preferences_snippet with $custom_preferences set to false.')
}
if $ensure == 'present' {
if $custom_preferences == false {
fail('Trying to define a preferences_snippet with $custom_preferences set to false.')
}
if !$pin and !$release {
fail('apt::preferences_snippet requires one of the \'pin\' or \'release\' argument to be set')
}
if $pin and $release {
fail('apt::preferences_snippet requires either a \'pin\' or \'release\' argument, not both')
if $priority == undef {
fail('apt::preferences_snippet requires the \'priority\' argument to be set')
}
if !$pin and !$release {
fail('apt::preferences_snippet requires one of the \'pin\' or \'release\' argument to be set')
}
if $pin and $release {
fail('apt::preferences_snippet requires either a \'pin\' or \'release\' argument, not both')
}
}
file { "/etc/apt/preferences.d/${name}":