X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fparams.pp;h=bcff6bd40d293cde5ed273e6d55495b2a252075a;hb=b51e1f2a9ab281819174bbe9fd62bae1f7d5b2c3;hp=3c169e3fcfa8c05a32e395f0fee531f9dd6ae8fc;hpb=3e44b685d2a0457774401f2f200e3ed82abeda4f;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/params.pp b/manifests/params.pp index 3c169e3..bcff6bd 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,7 +1,7 @@ class apt::params { - if $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') } $root = '/etc/apt' @@ -11,10 +11,16 @@ class apt::params { $conf_d = "${root}/apt.conf.d" $preferences = "${root}/preferences" $preferences_d = "${root}/preferences.d" - - if $::osfamily != 'Debian' { - fail('This module only works on Debian or derivatives like Ubuntu') - } + $keyserver = 'keyserver.ubuntu.com' + $confs = {} + $update = {} + $purge = {} + $proxy = {} + $sources = {} + $keys = {} + $ppas = {} + $pins = {} + $settings = {} $config_files = { 'conf' => { @@ -23,7 +29,7 @@ class apt::params { }, 'pref' => { 'path' => $preferences_d, - 'ext' => '', + 'ext' => '.pref', }, 'list' => { 'path' => $sources_list_d, @@ -31,64 +37,94 @@ class apt::params { } } - $proxy = { - 'host' => undef, - 'port' => 8080, + $update_defaults = { + 'frequency' => 'reluctantly', + 'timeout' => undef, + 'tries' => undef, } - $file_defaults = { - 'owner' => 'root', - 'group' => 'root', - 'mode' => '0644', + $proxy_defaults = { + 'ensure' => undef, + 'host' => undef, + 'port' => 8080, + 'https' => false, } - case $::lsbdistid { - 'ubuntu', 'debian': { - $distid = $::lsbdistid - $distcodename = $::lsbdistcodename - } - 'linuxmint': { - if $::lsbdistcodename == 'debian' { - $distid = 'debian' - $distcodename = 'wheezy' - } else { - $distid = 'ubuntu' - $distcodename = $::lsbdistcodename ? { - 'qiana' => 'trusty', - 'petra' => 'saucy', - 'olivia' => 'raring', - 'nadia' => 'quantal', - 'maya' => 'precise', + $purge_defaults = { + 'sources.list' => false, + 'sources.list.d' => false, + 'preferences' => false, + 'preferences.d' => false, + } + + $source_key_defaults = { + 'server' => $keyserver, + 'options' => undef, + 'content' => undef, + 'source' => undef, + } + + $include_defaults = { + 'deb' => true, + 'src' => false, + } + + case $facts['os']['name']{ + 'Debian': { + case $facts['os']['release']['full'] { + '6.0': { + $backports = { + 'location' => 'http://httpredir.debian.org/debian-backports', + 'key' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', + 'repos' => 'main contrib non-free', + } + } + default: { + $backports = { + 'location' => 'http://httpredir.debian.org/debian', + 'key' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', + 'repos' => 'main contrib non-free', + } } } + + $ppa_options = undef + $ppa_package = undef + } - '': { - fail('Unable to determine lsbdistid, is lsb-release installed?') - } - default: { - fail("Unsupported lsbdistid (${::lsbdistid})") - } - } - case $distid { - 'ubuntu': { - case $distcodename { - 'lucid': { + 'Ubuntu': { + $backports = { + 'location' => 'http://archive.ubuntu.com/ubuntu', + 'key' => '630239CC130E1A7FD81A27B140976EAF437D05B5', + 'repos' => 'main universe multiverse restricted', + } + + case $facts['os']['release']['full'] { + '10.04': { $ppa_options = undef $ppa_package = 'python-software-properties' } - 'precise': { + '12.04': { $ppa_options = '-y' $ppa_package = 'python-software-properties' } - 'trusty', 'utopic', 'vivid': { + '14.04', '14.10', '15.04', '15.10': { $ppa_options = '-y' $ppa_package = 'software-properties-common' } default: { $ppa_options = '-y' - $ppa_package = 'software-properties-common' + $ppa_package = 'python-software-properties' } } } + undef: { + fail('Unable to determine value for fact os["name"]') + } + default: { + $ppa_options = undef + $ppa_package = undef + $backports = undef + } } }