X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fparams.pp;h=42dd6b01290bae1783aadccaaae56eb84708f572;hb=1c707c7d323f80502e09008351c5007b385a1c97;hp=8edd2e7840583141b944e2e288c415f20b0f8ff4;hpb=001e3a42b971b12305b50859f99d4bce3f422d46;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/params.pp b/manifests/params.pp index 8edd2e7..42dd6b0 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -8,10 +8,31 @@ class apt::params { 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, }, } @@ -66,24 +87,18 @@ class apt::params { 'source' => undef, } - $file_defaults = { - 'owner' => 'root', - 'group' => 'root', - 'mode' => '0644', - } - - case $::lsbdistid { + case $xfacts['lsbdistid'] { 'ubuntu', 'debian': { - $distid = $::lsbdistid + $distid = $xfacts['lsbdistid'] $distcodename = $xfacts['lsbdistcodename'] } 'linuxmint': { - if $::lsbdistcodename == 'debian' { + if $xfacts['lsbdistcodename'] == 'debian' { $distid = 'debian' $distcodename = 'wheezy' } else { $distid = 'ubuntu' - $distcodename = $::lsbdistcodename ? { + $distcodename = $xfacts['lsbdistcodename'] ? { 'qiana' => 'trusty', 'petra' => 'saucy', 'olivia' => 'raring', @@ -92,7 +107,7 @@ class apt::params { } } } - '': { + undef: { fail('Unable to determine lsbdistid, is lsb-release installed?') } default: {