Skip to content

Commit 6ae260c

Browse files
simondezielkenyon
authored andcommitted
Add support for Ubuntu 20.04 (PHP 7.4)
Signed-off-by: Simon Deziel <[email protected]>
1 parent 661889a commit 6ae260c

File tree

8 files changed

+34
-2
lines changed

8 files changed

+34
-2
lines changed

.sync.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
- set: centos7-64
88
options:
99
script: 'bundle exec rspec spec/acceptance/php56_spec.rb'
10+
- set: ubuntu2004-64
11+
options:
12+
script: 'bundle exec rspec spec/acceptance/php_spec.rb'
1013
- set: ubuntu1804-64
1114
options:
1215
script: 'bundle exec rspec spec/acceptance/php_spec.rb'

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ jobs:
4444
env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=centos7-64 CHECK=beaker
4545
script: bundle exec rspec spec/acceptance/php56_spec.rb
4646
services: docker
47+
- rvm: 2.5.3
48+
bundler_args: --without development release
49+
env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu2004-64 CHECK=beaker
50+
script: bundle exec rspec spec/acceptance/php_spec.rb
51+
services: docker
4752
- rvm: 2.5.3
4853
bundler_args: --without development release
4954
env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=ubuntu1804-64 CHECK=beaker

manifests/globals.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
default => '7.3',
3232
},
3333
'Ubuntu' => $facts['os']['release']['major'] ? {
34+
'20.04' => '7.4',
3435
'16.04' => '7.0',
3536
default => '7.2',
3637
},

metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"operatingsystem": "Ubuntu",
4242
"operatingsystemrelease": [
4343
"16.04",
44-
"18.04"
44+
"18.04",
45+
"20.04"
4546
]
4647
},
4748
{

spec/acceptance/php_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
end
1111

1212
case default[:platform]
13+
when %r{ubuntu-20.04}
14+
packagename = 'php7.4-fpm'
1315
when %r{ubuntu-18.04}
1416
packagename = 'php7.2-fpm'
1517
when %r{ubuntu-16.04}
@@ -34,9 +36,11 @@
3436
end
3537
context 'default parameters with extensions' do
3638
case default[:platform]
37-
when %r{ubuntu-18.04}, %r{ubuntu-16.04}
39+
when %r{ubuntu-20.04}, %r{ubuntu-18.04}, %r{ubuntu-16.04}
3840
it 'works with defaults' do
3941
case default[:platform]
42+
when %r{ubuntu-20.04}
43+
simplexmlpackagename = 'php7.4-xml'
4044
when %r{ubuntu-18.04}
4145
simplexmlpackagename = 'php7.2-xml'
4246
when %r{ubuntu-16.04}
@@ -80,6 +84,8 @@
8084
end
8185

8286
case default[:platform]
87+
when %r{ubuntu-20.04}
88+
packagename = 'php7.4-fpm'
8389
when %r{ubuntu-18.04}
8490
packagename = 'php7.2-fpm'
8591
when %r{ubuntu-16.04}

spec/classes/php_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
end
2020
when 'Ubuntu'
2121
case facts[:os]['release']['major']
22+
when '20.04'
23+
'php7.4-cli'
2224
when '18.04'
2325
'php7.2-cli'
2426
when '16.04'
@@ -39,6 +41,8 @@
3941
end
4042
when 'Ubuntu'
4143
case facts[:os]['release']['major']
44+
when '20.04'
45+
'php7.4-fpm'
4246
when '18.04'
4347
'php7.2-fpm'
4448
when '16.04'
@@ -59,6 +63,8 @@
5963
end
6064
when 'Ubuntu'
6165
case facts[:os]['release']['major']
66+
when '20.04'
67+
'php7.4-dev'
6268
when '18.04'
6369
'php7.2-dev'
6470
when '16.04'
@@ -178,6 +184,8 @@
178184
end
179185
when 'Ubuntu'
180186
case facts[:os]['release']['major']
187+
when '20.04'
188+
'/etc/php/7.4/fpm/pool.d/www.conf'
181189
when '18.04'
182190
'/etc/php/7.2/fpm/pool.d/www.conf'
183191
when '16.04'
@@ -218,6 +226,8 @@
218226
end
219227
when 'Ubuntu'
220228
case facts[:os]['release']['major']
229+
when '20.04'
230+
'/etc/php/7.4/fpm/pool.d/www.conf'
221231
when '18.04'
222232
'/etc/php/7.2/fpm/pool.d/www.conf'
223233
when '16.04'
@@ -258,6 +268,8 @@
258268
end
259269
when 'Ubuntu'
260270
case facts[:os]['release']['major']
271+
when '20.04'
272+
'/etc/php/7.4/fpm/pool.d/www.conf'
261273
when '18.04'
262274
'/etc/php/7.2/fpm/pool.d/www.conf'
263275
when '16.04'

spec/defines/extension_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
end
2222
when 'Ubuntu'
2323
case facts[:os]['release']['major']
24+
when '20.04'
25+
'/etc/php/7.4/mods-available'
2426
when '18.04'
2527
'/etc/php/7.2/mods-available'
2628
when '16.04'

spec/defines/fpm_pool_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
let(:params) { {} }
3030

3131
case facts[:os]['release']['major']
32+
when '20.04'
33+
it { is_expected.to contain_file('/etc/php/7.4/fpm/pool.d/unique-name.conf') }
3234
when '18.04'
3335
it { is_expected.to contain_file('/etc/php/7.2/fpm/pool.d/unique-name.conf') }
3436
when '16.04'

0 commit comments

Comments
 (0)