From: TP Honey Date: Tue, 3 May 2016 10:36:27 +0000 (+0100) Subject: Merge pull request #605 from imphil/master X-Git-Tag: 2.3.0~16 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=39870ce9849d1915eeaf3137f17462bc8b2f6a62;hp=24eb0036304c538f560cf0187acdaf26029b1db4;p=puppet-modules%2Fpuppetlabs-apt.git Merge pull request #605 from imphil/master Install software-properties-common for xenial --- diff --git a/README.md b/README.md index 49266cc..422a862 100644 --- a/README.md +++ b/README.md @@ -420,8 +420,8 @@ Manages PPA repositories using `add-apt-repository`. Not supported on Debian. * `package_name`: Names the package that provides the `apt-add-repository` command. Valid options: a string. Defaults: * Lucid and Precise: 'python-software-properties' - * Trusty, Utopic, and Vivid: 'software-properties-common' - * All others: undef + * Trusty and newer: 'software-properties-common' + * All others: 'python-software-properties' * `release`: *Optional if lsb-release is installed (unless you're using a different release than indicated by lsb-release, e.g., Linux Mint).* Specifies the operating system of your node. Valid options: a string containing a valid LSB distribution codename. Default: "$lsbdistcodename". diff --git a/manifests/params.pp b/manifests/params.pp index a8f014b..179e2d6 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -131,23 +131,18 @@ class apt::params { 'repos' => 'main universe multiverse restricted', } - case $xfacts['lsbdistcodename'] { - 'lucid': { + if $xfacts['lsbdistcodename'] == 'lucid' { $ppa_options = undef $ppa_package = 'python-software-properties' - } - 'precise': { + } elsif $xfacts['lsbdistcodename'] == 'precise' { $ppa_options = '-y' $ppa_package = 'python-software-properties' - } - 'trusty', 'utopic', 'vivid', 'wily': { + } elsif versioncmp($xfacts['lsbdistrelease'], '14.04') >= 0 { $ppa_options = '-y' $ppa_package = 'software-properties-common' - } - default: { + } else { $ppa_options = '-y' $ppa_package = 'python-software-properties' - } } } undef: { diff --git a/spec/classes/apt_backports_spec.rb b/spec/classes/apt_backports_spec.rb index 496fec0..5762025 100644 --- a/spec/classes/apt_backports_spec.rb +++ b/spec/classes/apt_backports_spec.rb @@ -46,6 +46,7 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Ubuntu', :osfamily => 'Debian', :lsbdistcodename => 'trusty', + :lsbdistrelease => '14.04', :puppetversion => Puppet.version, } end @@ -64,6 +65,7 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Ubuntu', :osfamily => 'Debian', :lsbdistcodename => 'trusty', + :lsbdistrelease => '14.04', :puppetversion => Puppet.version, } end @@ -91,6 +93,7 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Ubuntu', :osfamily => 'Debian', :lsbdistcodename => 'trusty', + :lsbdistrelease => '14.04', :puppetversion => Puppet.version, } end @@ -201,6 +204,7 @@ describe 'apt::backports', :type => :class do :lsbdistid => 'Ubuntu', :osfamily => 'Debian', :lsbdistcodename => 'trusty', + :lsbdistrelease => '14.04', :puppetversion => Puppet.version, } end