X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fparams.pp;h=3ce8f4864007f151262e64f0fab3208bfa1ed5a3;hb=refs%2Fheads%2Frelease-prep;hp=c648c4ef992b853cacc0dea271a2ae0c4d21e207;hpb=8038d0a43280307c67cff5c610cb6c023683a10a;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/params.pp b/manifests/params.pp index c648c4e..3ce8f48 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,11 +1,10 @@ # @summary Provides defaults for the Apt module parameters. -# +# # @api private # class apt::params { - - if $::osfamily != 'Debian' { - fail(translate('This module only works on Debian or derivatives like Ubuntu')) + if $facts['os']['family'] != 'Debian' { + fail('This module only works on Debian or derivatives like Ubuntu') } $root = '/etc/apt' @@ -44,7 +43,7 @@ class apt::params { 'list' => { 'path' => $sources_list_d, 'ext' => '.list', - } + }, } $update_defaults = { @@ -71,31 +70,20 @@ class apt::params { 'apt.conf.d' => false, } - $source_key_defaults = { - 'server' => $keyserver, - 'options' => undef, - 'content' => undef, - 'source' => undef, - } - $include_defaults = { 'deb' => true, 'src' => false, } - case $facts['os']['name']{ + case $facts['os']['name'] { 'Debian': { - $backports = { - 'location' => 'http://deb.debian.org/debian', - 'repos' => 'main contrib non-free', - } + $backports = { + 'location' => 'http://deb.debian.org/debian', + 'repos' => 'main contrib non-free', + } $ppa_options = undef $ppa_package = undef - if versioncmp($facts['os']['release']['major'], '9') >= 0 { - $auth_conf_owner = '_apt' - } else { - $auth_conf_owner = 'root' - } + $auth_conf_owner = '_apt' } 'Ubuntu': { $backports = { @@ -103,16 +91,12 @@ class apt::params { 'key' => '630239CC130E1A7FD81A27B140976EAF437D05B5', 'repos' => 'main universe multiverse restricted', } - $ppa_options = '-y' + $ppa_options = ['-y'] $ppa_package = 'software-properties-common' - if versioncmp($facts['os']['release']['full'], '16.04') >= 0 { - $auth_conf_owner = '_apt' - } else { - $auth_conf_owner = 'root' - } + $auth_conf_owner = '_apt' } undef: { - fail(translate('Unable to determine value for fact os[\"name\"]')) + fail('Unable to determine value for fact os[\"name\"]') } default: { $ppa_options = undef