Skip to content

Commit

Permalink
Merge pull request #636 from voxpupuli/debian-ver
Browse files Browse the repository at this point in the history
Drop Debian 9/Ubuntu 16.04 support
  • Loading branch information
bastelfreak committed Aug 26, 2021
2 parents 6c8080c + 6910812 commit c51a971
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 53 deletions.
2 changes: 0 additions & 2 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@
) {
$default_php_version = $facts['os']['name'] ? {
'Debian' => $facts['os']['release']['major'] ? {
'9' => '7.0',
'10' => '7.3',
'11' => '7.4',
default => fail("Unsupported Debian release: ${fact('os.release.major')}"),
},
'Ubuntu' => $facts['os']['release']['major'] ? {
'16.04' => '7.0',
'18.04' => '7.2',
'20.04' => '7.4',
default => fail("Unsupported Ubuntu release: ${fact('os.release.major')}"),
Expand Down
2 changes: 1 addition & 1 deletion manifests/pear.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
false => undef,
}
# Default PHP come with xml module and no seperate package for it
if $facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '16.04') >= 0 {
if $facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '18.04') >= 0 {
ensure_packages(["${php::package_prefix}xml"], { ensure => present, require => $require, })

package { $package_name:
Expand Down
2 changes: 0 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"16.04",
"18.04",
"20.04"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"9",
"10",
"11"
]
Expand Down
12 changes: 1 addition & 11 deletions spec/acceptance/php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@
packagename = 'php7.4-fpm'
when %r{ubuntu-18.04}
packagename = 'php7.2-fpm'
when %r{ubuntu-16.04}
packagename = 'php7.0-fpm'
when %r{el}
packagename = 'php-fpm'
when %r{debian-9}
packagename = 'php7.0-fpm'
when %r{debian-10}
packagename = 'php7.3-fpm'
when %r{debian-11}
Expand All @@ -36,15 +32,13 @@
end
context 'default parameters with extensions' do
case default[:platform]
when %r{ubuntu-20.04}, %r{ubuntu-18.04}, %r{ubuntu-16.04}
when %r{ubuntu-20.04}, %r{ubuntu-18.04}
it 'works with defaults' do
case default[:platform]
when %r{ubuntu-20.04}
simplexmlpackagename = 'php7.4-xml'
when %r{ubuntu-18.04}
simplexmlpackagename = 'php7.2-xml'
when %r{ubuntu-16.04}
simplexmlpackagename = 'php7.0-xml'
end
pp = <<-EOS
class{'php':
Expand Down Expand Up @@ -85,12 +79,8 @@
packagename = 'php7.4-fpm'
when %r{ubuntu-18.04}
packagename = 'php7.2-fpm'
when %r{ubuntu-16.04}
packagename = 'php7.0-fpm'
when %r{el}
packagename = 'php-fpm'
when %r{debian-9}
packagename = 'php7.0-fpm'
when %r{debian-10}
packagename = 'php7.3-fpm'
when %r{debian-11}
Expand Down
8 changes: 6 additions & 2 deletions spec/classes/php_fpm_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@
case facts[:osfamily]
when 'Debian'
case facts[:operatingsystemrelease]
when '16.04'
it { is_expected.to contain_service('php7.0-fpm').with_ensure('running') }
when '18.04'
it { is_expected.to contain_service('php7.2-fpm').with_ensure('running') }
when '10'
it { is_expected.to contain_service('php7.3-fpm').with_ensure('running') }
when '20.04', '11'
it { is_expected.to contain_service('php7.4-fpm').with_ensure('running') }
end
when 'Suse'
it { is_expected.to contain_service('php-fpm').with_ensure('running') }
Expand Down
12 changes: 9 additions & 3 deletions spec/classes/php_fpm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@
case facts[:osfamily]
when 'Debian'
case facts[:operatingsystemrelease]
when '16.04'
it { is_expected.to contain_package('php7.0-fpm').with_ensure('present') }
it { is_expected.to contain_service('php7.0-fpm').with_ensure('running') }
when '18.04'
it { is_expected.to contain_package('php7.2-fpm').with_ensure('present') }
it { is_expected.to contain_service('php7.2-fpm').with_ensure('running') }
when '20.04', '11'
it { is_expected.to contain_package('php7.4-fpm').with_ensure('present') }
it { is_expected.to contain_service('php7.4-fpm').with_ensure('running') }
when '10'
it { is_expected.to contain_package('php7.3-fpm').with_ensure('present') }
it { is_expected.to contain_service('php7.3-fpm').with_ensure('running') }
end
when 'Suse'
it { is_expected.to contain_package('php5-fpm').with_ensure('present') }
Expand Down
24 changes: 0 additions & 24 deletions spec/classes/php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
'php7.4-cli'
when '10'
'php7.3-cli'
when '9'
'php7.0-cli'
else
'php5-cli'
end
Expand All @@ -25,8 +23,6 @@
'php7.4-cli'
when '18.04'
'php7.2-cli'
when '16.04'
'php7.0-cli'
else
'php5-cli'
end
Expand All @@ -38,8 +34,6 @@
'php7.4-fpm'
when '10'
'php7.3-fpm'
when '9'
'php7.0-fpm'
else
'php5-fpm'
end
Expand All @@ -49,8 +43,6 @@
'php7.4-fpm'
when '18.04'
'php7.2-fpm'
when '16.04'
'php7.0-fpm'
else
'php5-fpm'
end
Expand All @@ -62,8 +54,6 @@
'php7.4-dev'
when '10'
'php7.3-dev'
when '9'
'php7.0-dev'
else
'php5-dev'
end
Expand All @@ -73,8 +63,6 @@
'php7.4-dev'
when '18.04'
'php7.2-dev'
when '16.04'
'php7.0-dev'
else
'php5-dev'
end
Expand Down Expand Up @@ -185,8 +173,6 @@
'/etc/php/7.4/fpm/pool.d/www.conf'
when '10'
'/etc/php/7.3/fpm/pool.d/www.conf'
when '9'
'/etc/php/7.0/fpm/pool.d/www.conf'
else
'/etc/php5/fpm/pool.d/www.conf'
end
Expand All @@ -196,8 +182,6 @@
'/etc/php/7.4/fpm/pool.d/www.conf'
when '18.04'
'/etc/php/7.2/fpm/pool.d/www.conf'
when '16.04'
'/etc/php/7.0/fpm/pool.d/www.conf'
else
'/etc/php5/fpm/pool.d/www.conf'
end
Expand Down Expand Up @@ -229,8 +213,6 @@
'/etc/php/7.4/fpm/pool.d/www.conf'
when '10'
'/etc/php/7.3/fpm/pool.d/www.conf'
when '9'
'/etc/php/7.0/fpm/pool.d/www.conf'
else
'/etc/php5/fpm/pool.d/www.conf'
end
Expand All @@ -240,8 +222,6 @@
'/etc/php/7.4/fpm/pool.d/www.conf'
when '18.04'
'/etc/php/7.2/fpm/pool.d/www.conf'
when '16.04'
'/etc/php/7.0/fpm/pool.d/www.conf'
else
'/etc/php5/fpm/pool.d/www.conf'
end
Expand Down Expand Up @@ -273,8 +253,6 @@
'/etc/php/7.4/fpm/pool.d/www.conf'
when '10'
'/etc/php/7.3/fpm/pool.d/www.conf'
when '9'
'/etc/php/7.0/fpm/pool.d/www.conf'
else
'/etc/php5/fpm/pool.d/www.conf'
end
Expand All @@ -284,8 +262,6 @@
'/etc/php/7.4/fpm/pool.d/www.conf'
when '18.04'
'/etc/php/7.2/fpm/pool.d/www.conf'
when '16.04'
'/etc/php/7.0/fpm/pool.d/www.conf'
else
'/etc/php5/fpm/pool.d/www.conf'
end
Expand Down
4 changes: 0 additions & 4 deletions spec/defines/extension_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
'/etc/php/7.4/mods-available'
when '10'
'/etc/php/7.3/mods-available'
when '9'
'/etc/php/7.0/mods-available'
else
'/etc/php5/mods-available'
end
Expand All @@ -27,8 +25,6 @@
'/etc/php/7.4/mods-available'
when '18.04'
'/etc/php/7.2/mods-available'
when '16.04'
'/etc/php/7.0/mods-available'
else
'/etc/php5/mods-available'
end
Expand Down
4 changes: 0 additions & 4 deletions spec/defines/fpm_pool_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
it { is_expected.to contain_file('/etc/php/7.4/fpm/pool.d/unique-name.conf') }
when '10'
it { is_expected.to contain_file('/etc/php/7.3/fpm/pool.d/unique-name.conf') }
when '9'
it { is_expected.to contain_file('/etc/php/7.0/fpm/pool.d/unique-name.conf') }
else
it { is_expected.to contain_file('/etc/php5/fpm/pool.d/unique-name.conf') }
end
Expand All @@ -35,8 +33,6 @@
it { is_expected.to contain_file('/etc/php/7.4/fpm/pool.d/unique-name.conf') }
when '18.04'
it { is_expected.to contain_file('/etc/php/7.2/fpm/pool.d/unique-name.conf') }
when '16.04'
it { is_expected.to contain_file('/etc/php/7.0/fpm/pool.d/unique-name.conf') }
else
it { is_expected.to contain_file('/etc/php5/fpm/pool.d/unique-name.conf') }
end
Expand Down

0 comments on commit c51a971

Please sign in to comment.