Skip to content

Commit f4465f4

Browse files
authored
Merge pull request voxpupuli#592 from bastelfreak/debian
Drop EOL Debian 7/8 & Ubuntu 12/14
2 parents d7bcc0a + ec80be8 commit f4465f4

14 files changed

+48
-94
lines changed

.fixtures.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ fixtures:
22
repositories:
33
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
44
apt: "https://github.com/puppetlabs/puppetlabs-apt.git"
5+
translate: "https://github.com/puppetlabs/puppetlabs-translate.git"
56
zypprepo: "https://github.com/deadpoint/puppet-zypprepo.git"
67
inifile: "https://github.com/puppetlabs/puppetlabs-inifile.git"
78
archive: "https://github.com/voxpupuli/puppet-archive.git"

manifests/dev.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
}
3333

3434
# Default PHP come with xml module and no seperate package for it
35-
if $facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '16.04') >= 0 {
35+
if $facts['os']['name'] == 'Ubuntu' {
3636
ensure_packages(["${php::package_prefix}xml"], { ensure => present, require => $require, })
3737
}
3838
package { $real_package:

manifests/fpm.pp

-15
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,4 @@
107107
$real_global_pool_settings = $global_pool_settings
108108
$real_pools = $pools
109109
create_resources(::php::fpm::pool, $real_pools, $real_global_pool_settings)
110-
111-
# Create an override to use a reload signal as trusty and utopic's
112-
# upstart version supports this
113-
if ($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '14') >= 0 and versioncmp($facts['os']['release']['full'], '16') < 0) {
114-
if ($service_enable) {
115-
$fpm_override = 'reload signal USR2'
116-
}
117-
else {
118-
$fpm_override = "reload signal USR2\nmanual"
119-
}
120-
file { "/etc/init/${php::fpm::service::service_name}.override":
121-
content => $fpm_override,
122-
before => Package[$real_package],
123-
}
124-
}
125110
}

manifests/fpm/service.pp

+1-11
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,7 @@
2424
warning('php::fpm::service is private')
2525
}
2626

27-
$reload = "service ${service_name} reload"
28-
29-
if ($facts['os']['name'] == 'Ubuntu'
30-
and versioncmp($facts['os']['release']['full'], '12') >= 0
31-
and versioncmp($facts['os']['release']['full'], '14') < 0) {
32-
# Precise upstart doesn't support reload signals, so use
33-
# regular service restart instead
34-
$restart = undef
35-
} else {
36-
$restart = $reload
37-
}
27+
$restart = "service ${service_name} reload"
3828

3929
service { $service_name:
4030
ensure => $ensure,

manifests/globals.pp

+2-13
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@
2828
$default_php_version = $facts['os']['name'] ? {
2929
'Debian' => $facts['os']['release']['major'] ? {
3030
'9' => '7.0',
31-
'10' => '7.3',
32-
default => '5.x',
31+
default => '7.3',
3332
},
3433
'Ubuntu' => $facts['os']['release']['major'] ? {
35-
'18.04' => '7.2',
3634
'16.04' => '7.0',
37-
default => '5.x',
35+
default => '7.2',
3836
},
3937
default => '5.x',
4038
}
@@ -45,15 +43,6 @@
4543
'Debian': {
4644
if $facts['os']['name'] == 'Ubuntu' {
4745
case $globals_php_version {
48-
/^5\.4/: {
49-
$default_config_root = '/etc/php5'
50-
$default_fpm_pid_file = "/var/run/php/php${globals_php_version}-fpm.pid"
51-
$fpm_error_log = '/var/log/php5-fpm.log'
52-
$fpm_service_name = 'php5-fpm'
53-
$ext_tool_enable = '/usr/sbin/php5enmod'
54-
$ext_tool_query = '/usr/sbin/php5query'
55-
$package_prefix = 'php5-'
56-
}
5746
/^[57].[0-9]/: {
5847
$default_config_root = "/etc/php/${globals_php_version}"
5948
$default_fpm_pid_file = "/var/run/php/php${globals_php_version}-fpm.pid"

manifests/repo/debian.pp

+1-17
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,7 @@
5050
key => $key,
5151
}
5252

53-
if ($dotdeb) {
54-
# both repositories are required to work correctly
55-
# See: http://www.dotdeb.org/instructions/
56-
if $release == 'wheezy-php56' {
57-
apt::source { 'dotdeb-wheezy':
58-
location => $location,
59-
release => 'wheezy',
60-
repos => $repos,
61-
include => {
62-
'src' => $include_src,
63-
'deb' => true,
64-
},
65-
}
66-
}
67-
}
68-
69-
if ($sury and $php::globals::php_version in ['5.6','7.1','7.2']) {
53+
if ($sury and $php::globals::php_version in ['7.1','7.2']) {
7054
apt::source { 'source_php_sury':
7155
location => 'https://packages.sury.org/php/',
7256
repos => 'main',

manifests/repo/ubuntu.pp

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
class php::repo::ubuntu (
99
$version = undef,
1010
) {
11+
if $facts['os']['name'] != 'Ubuntu' {
12+
fail("class php::repo::ubuntu does not work on OS ${facts['os']['name']}")
13+
}
1114
include 'apt'
1215

1316
if($version == undef) {

metadata.json

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
{
4848
"operatingsystem": "Debian",
4949
"operatingsystemrelease": [
50-
"8",
5150
"9",
5251
"10"
5352
]

spec/classes/php_fpm_config_spec.rb

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
facts
99
end
1010

11+
describe 'works without params' do
12+
it { is_expected.to compile.with_all_deps }
13+
it { is_expected.to contain_class('php::globals') }
14+
it { is_expected.to contain_class('php::params') }
15+
end
1116
describe 'creates config file' do
1217
let(:params) do
1318
{

spec/classes/php_fpm_service_spec.rb

+14
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99

1010
let(:pre_condition) { 'class {"php": fpm => true}' }
1111

12+
describe 'works without default' do
13+
it { is_expected.to compile.with_all_deps }
14+
it { is_expected.to contain_class('php::cli') }
15+
it { is_expected.to contain_class('php::composer::auto_update') }
16+
it { is_expected.to contain_class('php::composer') }
17+
it { is_expected.to contain_class('php::dev') }
18+
it { is_expected.to contain_class('php::fpm::config') }
19+
it { is_expected.to contain_class('php::fpm') }
20+
it { is_expected.to contain_class('php::packages') }
21+
it { is_expected.to contain_class('php::globals') }
22+
it { is_expected.to contain_class('php::params') }
23+
it { is_expected.to contain_class('php::pear') }
24+
end
25+
1226
describe 'when called with no parameters' do
1327
# rubocop:disable RSpec/RepeatedExample
1428
case facts[:osfamily]

spec/classes/php_fpm_spec.rb

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
end
99
let(:pre_condition) { 'class {"php": fpm => false}' }
1010

11+
describe 'works without params' do
12+
it { is_expected.to compile.with_all_deps }
13+
end
14+
1115
describe 'when called with no parameters' do
1216
# rubocop:disable RSpec/RepeatedExample
1317
case facts[:osfamily]

spec/classes/php_repo_spec.rb

+7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
'include php'
1212
end
1313

14+
describe 'works without params' do
15+
if facts[:os]['name'] == 'Archlinux'
16+
it { is_expected.to compile.and_raise_error(%r{No repo available for}) }
17+
else
18+
it { is_expected.to compile.with_all_deps }
19+
end
20+
end
1421
describe 'when configuring a package repo' do
1522
case facts[:osfamily]
1623
when 'Debian'

spec/classes/php_repo_ubuntu_spec.rb

+6-35
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,13 @@
77
facts
88
end
99

10-
case facts[:lsbdistcodename]
11-
when 'trusty'
12-
describe 'when called with no parameters on Ubuntu trusty' do
13-
it { is_expected.to contain_exec('add-apt-repository-ppa:ondrej/php') }
10+
describe 'works without params' do
11+
if facts[:os]['name'] == 'Ubuntu'
12+
it { is_expected.to compile.with_all_deps }
13+
it { is_expected.to contain_apt__ppa('ppa:ondrej/php') }
14+
else
15+
it { is_expected.to compile.and_raise_error(%r{class php::repo::ubuntu does not work on OS}) }
1416
end
15-
16-
describe 'when called with version 7.0 on Ubuntu trusty' do
17-
let(:params) do
18-
{
19-
version: '7.0'
20-
}
21-
end
22-
23-
it { is_expected.to contain_exec('add-apt-repository-ppa:ondrej/php') }
24-
end
25-
26-
describe 'when call with version 5.6 on Ubuntu trusty' do
27-
let(:params) do
28-
{
29-
version: '5.6'
30-
}
31-
end
32-
33-
it { is_expected.to contain_exec('add-apt-repository-ppa:ondrej/php') }
34-
end
35-
36-
describe 'when call with version 5.4 on Ubuntu trusty' do
37-
let(:params) do
38-
{
39-
version: '5.4'
40-
}
41-
end
42-
43-
it { is_expected.to raise_error(Puppet::Error) }
44-
end
45-
4617
end
4718
end
4819
end

spec/classes/php_spec.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@
6767
'php5-dev'
6868
end
6969
end
70-
70+
describe 'works without params' do
71+
it { is_expected.to compile.with_all_deps }
72+
end
7173
describe 'when called with no parameters' do
7274
case facts[:osfamily]
7375
when 'Suse', 'RedHat', 'CentOS'

0 commit comments

Comments
 (0)