Skip to content

Commit f4465f4

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

14 files changed

Lines changed: 48 additions & 94 deletions

.fixtures.yml

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 15 deletions
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

Lines changed: 1 addition & 11 deletions
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

Lines changed: 2 additions & 13 deletions
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

Lines changed: 1 addition & 17 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 5 additions & 0 deletions
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

Lines changed: 14 additions & 0 deletions
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]

0 commit comments

Comments
 (0)