X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fparams.pp;h=bcff6bd40d293cde5ed273e6d55495b2a252075a;hb=b51e1f2a9ab281819174bbe9fd62bae1f7d5b2c3;hp=32e4dbae6f6a936f109fbd73d373fd26c8733272;hpb=55a17ac5916110ad996e85af05a18fbdf21a90d5;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/params.pp b/manifests/params.pp index 32e4dba..bcff6bd 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -4,47 +4,6 @@ class apt::params { fail('This module only works on Debian or derivatives like Ubuntu') } - # prior to puppet 3.5.0, defined couldn't test if a variable was defined - # strict variables wasn't added until 3.5.0, so this should be fine. - if versioncmp($::puppetversion, '3.5.0') < 0 { - $xfacts = { - 'lsbdistcodename' => $::lsbdistcodename, - 'lsbdistrelease' => $::lsbdistrelease, - 'lsbmajdistrelease' => $::lsbmajdistrelease, - 'lsbdistdescription' => $::lsbdistdescription, - 'lsbminordistrelease' => $::lsbminordistrelease, - 'lsbdistid' => $::lsbdistid, - } - } else { - # Strict variables facts lookup compatibility - $xfacts = { - 'lsbdistcodename' => defined('$lsbdistcodename') ? { - true => $::lsbdistcodename, - 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, - }, - } - } - $root = '/etc/apt' $provider = '/usr/bin/apt-get' $sources_list = "${root}/sources.list" @@ -53,6 +12,15 @@ class apt::params { $preferences = "${root}/preferences" $preferences_d = "${root}/preferences.d" $keyserver = 'keyserver.ubuntu.com' + $confs = {} + $update = {} + $purge = {} + $proxy = {} + $sources = {} + $keys = {} + $ppas = {} + $pins = {} + $settings = {} $config_files = { 'conf' => { @@ -61,7 +29,7 @@ class apt::params { }, 'pref' => { 'path' => $preferences_d, - 'ext' => '', + 'ext' => '.pref', }, 'list' => { 'path' => $sources_list_d, @@ -76,9 +44,10 @@ class apt::params { } $proxy_defaults = { - 'host' => undef, - 'port' => 8080, - 'https' => false, + 'ensure' => undef, + 'host' => undef, + 'port' => 8080, + 'https' => false, } $purge_defaults = { @@ -100,19 +69,19 @@ class apt::params { 'src' => false, } - case $xfacts['lsbdistid'] { - 'debian': { - case $xfacts['lsbdistcodename'] { - 'squeeze': { + case $facts['os']['name']{ + 'Debian': { + case $facts['os']['release']['full'] { + '6.0': { $backports = { - 'location' => 'http://backports.debian.org/debian-backports', + 'location' => 'http://httpredir.debian.org/debian-backports', 'key' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', 'repos' => 'main contrib non-free', } } default: { $backports = { - 'location' => 'http://ftp.debian.org/debian/', + 'location' => 'http://httpredir.debian.org/debian', 'key' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', 'repos' => 'main contrib non-free', } @@ -123,23 +92,23 @@ class apt::params { $ppa_package = undef } - 'ubuntu': { + 'Ubuntu': { $backports = { 'location' => 'http://archive.ubuntu.com/ubuntu', 'key' => '630239CC130E1A7FD81A27B140976EAF437D05B5', 'repos' => 'main universe multiverse restricted', } - case $xfacts['lsbdistcodename'] { - 'lucid': { + 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' } @@ -150,7 +119,7 @@ class apt::params { } } undef: { - fail('Unable to determine lsbdistid, is lsb-release installed?') + fail('Unable to determine value for fact os["name"]') } default: { $ppa_options = undef