Install software-properties-common for xenial

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.
This commit is contained in:
Philipp Wagner 2016-04-29 14:20:53 +02:00
parent 24eb003630
commit e651d7d25c
3 changed files with 10 additions and 11 deletions

View file

@ -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: * `package_name`: Names the package that provides the `apt-add-repository` command. Valid options: a string. Defaults:
* Lucid and Precise: 'python-software-properties' * Lucid and Precise: 'python-software-properties'
* Trusty, Utopic, and Vivid: 'software-properties-common' * Trusty and newer: 'software-properties-common'
* All others: undef * 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". * `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".

View file

@ -131,23 +131,18 @@ class apt::params {
'repos' => 'main universe multiverse restricted', 'repos' => 'main universe multiverse restricted',
} }
case $xfacts['lsbdistcodename'] { if $xfacts['lsbdistcodename'] == 'lucid' {
'lucid': {
$ppa_options = undef $ppa_options = undef
$ppa_package = 'python-software-properties' $ppa_package = 'python-software-properties'
} } elsif $xfacts['lsbdistcodename'] == 'precise' {
'precise': {
$ppa_options = '-y' $ppa_options = '-y'
$ppa_package = 'python-software-properties' $ppa_package = 'python-software-properties'
} } elsif versioncmp($xfacts['lsbdistrelease'], '14.04') >= 0 {
'trusty', 'utopic', 'vivid', 'wily': {
$ppa_options = '-y' $ppa_options = '-y'
$ppa_package = 'software-properties-common' $ppa_package = 'software-properties-common'
} } else {
default: {
$ppa_options = '-y' $ppa_options = '-y'
$ppa_package = 'python-software-properties' $ppa_package = 'python-software-properties'
}
} }
} }
undef: { undef: {

View file

@ -46,6 +46,7 @@ describe 'apt::backports', :type => :class do
:lsbdistid => 'Ubuntu', :lsbdistid => 'Ubuntu',
:osfamily => 'Debian', :osfamily => 'Debian',
:lsbdistcodename => 'trusty', :lsbdistcodename => 'trusty',
:lsbdistrelease => '14.04',
:puppetversion => Puppet.version, :puppetversion => Puppet.version,
} }
end end
@ -64,6 +65,7 @@ describe 'apt::backports', :type => :class do
:lsbdistid => 'Ubuntu', :lsbdistid => 'Ubuntu',
:osfamily => 'Debian', :osfamily => 'Debian',
:lsbdistcodename => 'trusty', :lsbdistcodename => 'trusty',
:lsbdistrelease => '14.04',
:puppetversion => Puppet.version, :puppetversion => Puppet.version,
} }
end end
@ -91,6 +93,7 @@ describe 'apt::backports', :type => :class do
:lsbdistid => 'Ubuntu', :lsbdistid => 'Ubuntu',
:osfamily => 'Debian', :osfamily => 'Debian',
:lsbdistcodename => 'trusty', :lsbdistcodename => 'trusty',
:lsbdistrelease => '14.04',
:puppetversion => Puppet.version, :puppetversion => Puppet.version,
} }
end end
@ -201,6 +204,7 @@ describe 'apt::backports', :type => :class do
:lsbdistid => 'Ubuntu', :lsbdistid => 'Ubuntu',
:osfamily => 'Debian', :osfamily => 'Debian',
:lsbdistcodename => 'trusty', :lsbdistcodename => 'trusty',
:lsbdistrelease => '14.04',
:puppetversion => Puppet.version, :puppetversion => Puppet.version,
} }
end end