From d3ca10fd2f31d0161bcfc65c263bd044537a3c48 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Tue, 7 Apr 2015 15:45:20 -0700 Subject: [PATCH] Remove default support for Linux Mint and Cumulus Networks NOTE: While out-of-the box support is disabled, it is still possible to get the same configurations, it will just require explicitly setting the necessary codename-munging. This should only affect `apt::ppa` --- manifests/params.pp | 40 ++++++------------------------------- manifests/ppa.pp | 4 ++-- spec/classes/params_spec.rb | 13 ------------ spec/defines/ppa_spec.rb | 2 +- 4 files changed, 9 insertions(+), 50 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index ef9904d..abc7536 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -88,39 +88,8 @@ class apt::params { } case $xfacts['lsbdistid'] { - 'ubuntu', 'debian': { - $distid = $xfacts['lsbdistid'] - $distcodename = $xfacts['lsbdistcodename'] - } - 'linuxmint': { - if $xfacts['lsbdistcodename'] == 'debian' { - $distid = 'debian' - $distcodename = 'wheezy' - } else { - $distid = 'ubuntu' - $distcodename = $xfacts['lsbdistcodename'] ? { - 'qiana' => 'trusty', - 'petra' => 'saucy', - 'olivia' => 'raring', - 'nadia' => 'quantal', - 'maya' => 'precise', - } - } - } - 'Cumulus Networks': { - $distid = 'debian' - $distcodename = $::lsbdistcodename - } - undef: { - fail('Unable to determine lsbdistid, is lsb-release installed?') - } - default: { - fail("Unsupported lsbdistid (${::lsbdistid})") - } - } - case $distid { 'debian': { - case $distcodename { + case $xfacts['lsbdistcodename'] { 'squeeze': { $backports = { 'location' => 'http://backports.debian.org/debian-backports', @@ -144,7 +113,7 @@ class apt::params { 'repos' => 'main universe multiverse restricted', } - case $distcodename { + case $xfacts['lsbdistcodename'] { 'lucid': { $ppa_options = undef $ppa_package = 'python-software-properties' @@ -163,7 +132,10 @@ class apt::params { } } } - '', default: { + undef: { + fail('Unable to determine lsbdistid, is lsb-release installed?') + } + default: { $ppa_options = undef $ppa_package = undef $backports = undef diff --git a/manifests/ppa.pp b/manifests/ppa.pp index 5d4c890..808c975 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -10,8 +10,8 @@ define apt::ppa( fail('lsbdistcodename fact not available: release parameter required') } - if $::apt::distid != 'ubuntu' { - fail('apt::ppa is currently supported on Ubuntu and LinuxMint only.') + if $::apt::xfacts['lsbdistid'] == 'Debian' { + fail('apt::ppa is not currently supported on Debian.') } $filename_without_slashes = regsubst($name, '/', '-', 'G') diff --git a/spec/classes/params_spec.rb b/spec/classes/params_spec.rb index f8ca89f..f8599b3 100644 --- a/spec/classes/params_spec.rb +++ b/spec/classes/params_spec.rb @@ -12,19 +12,6 @@ describe 'apt::params', :type => :class do expect(subject.resources.size).to eq(4) end - describe "With unknown lsbdistid" do - - let(:facts) { { :lsbdistid => 'CentOS', :osfamily => 'Debian' } } - let (:title) { 'my_package' } - - it do - expect { - is_expected.to compile - }.to raise_error(Puppet::Error, /Unsupported lsbdistid/) - end - - end - describe "With lsb-release not installed" do let(:facts) { { :lsbdistid => '', :osfamily => 'Debian' } } let (:title) { 'my_package' } diff --git a/spec/defines/ppa_spec.rb b/spec/defines/ppa_spec.rb index 7903e47..521b42b 100644 --- a/spec/defines/ppa_spec.rb +++ b/spec/defines/ppa_spec.rb @@ -298,7 +298,7 @@ describe 'apt::ppa' do it do expect { is_expected.to compile - }.to raise_error(Puppet::Error, /supported on Ubuntu and LinuxMint only/) + }.to raise_error(Puppet::Error, /not currently supported on Debian/) end end end -- 2.32.3