X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fparams.pp;h=aa90a7dd32ef7b7f1512694a5f176c9a0d9fb75e;hb=6dc52c169e60bc6ae6a9cf94624cce9c9d5a315a;hp=ca5d65521d22b915c96e09430b33a2c06ffb8ef2;hpb=9f570782aa9706c03750cd06dcb500a9a04700e2;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/params.pp b/manifests/params.pp index ca5d655..aa90a7d 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -2,4 +2,53 @@ class apt::params { $root = '/etc/apt' $provider = '/usr/bin/apt-get' $sources_list_d = "${root}/sources.list.d" + $apt_conf_d = "${root}/apt.conf.d" + $preferences_d = "${root}/preferences.d" + + if $::osfamily != 'Debian' { + fail('This module only works on Debian or derivatives like Ubuntu') + } + + 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', + } + } + } + '': { + fail('Unable to determine lsbdistid, is lsb-release installed?') + } + default: { + fail("Unsupported lsbdistid (${::lsbdistid})") + } + } + case $distid { + 'ubuntu': { + case $distcodename { + 'lucid': { + $ppa_options = undef + } + 'precise', 'trusty', 'utopic', 'vivid': { + $ppa_options = '-y' + } + default: { + $ppa_options = '-y' + } + } + } + } }