X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fparams.pp;h=abc7536eabc2be7f6119be19645fc41689e6fb50;hb=d3ca10fd2f31d0161bcfc65c263bd044537a3c48;hp=8edd2e7840583141b944e2e288c415f20b0f8ff4;hpb=001e3a42b971b12305b50859f99d4bce3f422d46;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/params.pp b/manifests/params.pp index 8edd2e7..abc7536 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,17 +1,34 @@ class apt::params { - if defined('$caller_module_name') and $caller_module_name and $caller_module_name != $module_name { - fail('apt::params is a private class and cannot be accessed directly') - } - if $::osfamily != 'Debian' { fail('This module only works on Debian or derivatives like Ubuntu') } + # Strict variables facts lookup compatibility $xfacts = { 'lsbdistcodename' => defined('$lsbdistcodename') ? { true => $::lsbdistcodename, - default => undef + default => undef, + }, + 'lsbdistrelease' => defined('$lsbdistrelease') ? { + true => $::lsbdistrelease, + default => undef, + }, + 'lsbmajdistrelease' => defined('$lsbmajdistrelease') ? { + true => $::lsbmajdistrelease, + default => undef, + }, + 'lsbdistdescription' => defined('$lsbdistdescription') ? { + true => $::lsbdistdescription, + default => undef, + }, + 'lsbminordistrelease' => defined('$lsbminordistrelease') ? { + true => $::lsbminordistrelease, + default => undef, + }, + 'lsbdistid' => defined('$lsbdistid') ? { + true => $::lsbdistid, + default => undef, }, } @@ -40,7 +57,6 @@ class apt::params { } $update_defaults = { - 'always' => false, 'frequency' => 'reluctantly', 'timeout' => undef, 'tries' => undef, @@ -66,42 +82,38 @@ class apt::params { 'source' => undef, } - $file_defaults = { - 'owner' => 'root', - 'group' => 'root', - 'mode' => '0644', + $include_defaults = { + 'deb' => true, + 'src' => false, } - case $::lsbdistid { - 'ubuntu', 'debian': { - $distid = $::lsbdistid - $distcodename = $xfacts['lsbdistcodename'] - } - 'linuxmint': { - if $::lsbdistcodename == 'debian' { - $distid = 'debian' - $distcodename = 'wheezy' - } else { - $distid = 'ubuntu' - $distcodename = $::lsbdistcodename ? { - 'qiana' => 'trusty', - 'petra' => 'saucy', - 'olivia' => 'raring', - 'nadia' => 'quantal', - 'maya' => 'precise', + case $xfacts['lsbdistid'] { + 'debian': { + case $xfacts['lsbdistcodename'] { + 'squeeze': { + $backports = { + 'location' => 'http://backports.debian.org/debian-backports', + 'key' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', + 'repos' => 'main contrib non-free', + } + } + default: { + $backports = { + 'location' => 'http://ftp.debian.org/debian/', + 'key' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', + 'repos' => 'main contrib non-free', + } } } } - '': { - fail('Unable to determine lsbdistid, is lsb-release installed?') - } - default: { - fail("Unsupported lsbdistid (${::lsbdistid})") - } - } - case $distid { 'ubuntu': { - case $distcodename { + $backports = { + 'location' => 'http://archive.ubuntu.com/ubuntu', + 'key' => '630239CC130E1A7FD81A27B140976EAF437D05B5', + 'repos' => 'main universe multiverse restricted', + } + + case $xfacts['lsbdistcodename'] { 'lucid': { $ppa_options = undef $ppa_package = 'python-software-properties' @@ -116,13 +128,17 @@ class apt::params { } default: { $ppa_options = '-y' - $ppa_package = 'software-properties-common' + $ppa_package = 'python-software-properties' } } } - '', default: { + undef: { + fail('Unable to determine lsbdistid, is lsb-release installed?') + } + default: { $ppa_options = undef $ppa_package = undef + $backports = undef } } }