]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Install software-properties-common for xenial
authorPhilipp Wagner <philipp.wagner@tum.de>
Fri, 29 Apr 2016 12:20:53 +0000 (14:20 +0200)
committerPhilipp Wagner <philipp.wagner@tum.de>
Mon, 2 May 2016 11:53:09 +0000 (13:53 +0200)
Instead of adding every newer release of Ubuntu, let's assume that the
package name that is used today will be used in the future, until the
next change is necessary.

README.md
manifests/params.pp
spec/classes/apt_backports_spec.rb

index 49266cc913b3837839694b9b52de0c05b42f1c67..422a862f5f5433f2727fc9f32bca2e88045b0b84 100644 (file)
--- 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".
 
index a8f014b8f3c61f244cc2df7c8173fb7683a460c9..179e2d631114b1c242679f728db3d7017181018a 100644 (file)
@@ -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: {
index 496fec0cdf532271d864d6d8117bfe00393bd428..5762025eaff44ad5002bc3d58e7ad983f4589084 100644 (file)
@@ -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