Skip to content

Commit

Permalink
Merge pull request voxpupuli#599 from simondeziel/ubuntu-20.04
Browse files Browse the repository at this point in the history
php::globals: support Ubuntu 20.04 that ships php 7.4
  • Loading branch information
bastelfreak authored Nov 16, 2020
2 parents 661889a + 6ae260c commit b850252
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
- set: centos7-64
options:
script: 'bundle exec rspec spec/acceptance/php56_spec.rb'
- set: ubuntu2004-64
options:
script: 'bundle exec rspec spec/acceptance/php_spec.rb'
- set: ubuntu1804-64
options:
script: 'bundle exec rspec spec/acceptance/php_spec.rb'
Expand Down
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ jobs:
env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=centos7-64 CHECK=beaker
script: bundle exec rspec spec/acceptance/php56_spec.rb
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu2004-64 CHECK=beaker
script: bundle exec rspec spec/acceptance/php_spec.rb
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=ubuntu1804-64 CHECK=beaker
Expand Down
1 change: 1 addition & 0 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
default => '7.3',
},
'Ubuntu' => $facts['os']['release']['major'] ? {
'20.04' => '7.4',
'16.04' => '7.0',
default => '7.2',
},
Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"16.04",
"18.04"
"18.04",
"20.04"
]
},
{
Expand Down
8 changes: 7 additions & 1 deletion spec/acceptance/php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
end

case default[:platform]
when %r{ubuntu-20.04}
packagename = 'php7.4-fpm'
when %r{ubuntu-18.04}
packagename = 'php7.2-fpm'
when %r{ubuntu-16.04}
Expand All @@ -34,9 +36,11 @@
end
context 'default parameters with extensions' do
case default[:platform]
when %r{ubuntu-18.04}, %r{ubuntu-16.04}
when %r{ubuntu-20.04}, %r{ubuntu-18.04}, %r{ubuntu-16.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}
Expand Down Expand Up @@ -80,6 +84,8 @@
end

case default[:platform]
when %r{ubuntu-20.04}
packagename = 'php7.4-fpm'
when %r{ubuntu-18.04}
packagename = 'php7.2-fpm'
when %r{ubuntu-16.04}
Expand Down
12 changes: 12 additions & 0 deletions spec/classes/php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '20.04'
'php7.4-cli'
when '18.04'
'php7.2-cli'
when '16.04'
Expand All @@ -39,6 +41,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '20.04'
'php7.4-fpm'
when '18.04'
'php7.2-fpm'
when '16.04'
Expand All @@ -59,6 +63,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '20.04'
'php7.4-dev'
when '18.04'
'php7.2-dev'
when '16.04'
Expand Down Expand Up @@ -178,6 +184,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '20.04'
'/etc/php/7.4/fpm/pool.d/www.conf'
when '18.04'
'/etc/php/7.2/fpm/pool.d/www.conf'
when '16.04'
Expand Down Expand Up @@ -218,6 +226,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '20.04'
'/etc/php/7.4/fpm/pool.d/www.conf'
when '18.04'
'/etc/php/7.2/fpm/pool.d/www.conf'
when '16.04'
Expand Down Expand Up @@ -258,6 +268,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '20.04'
'/etc/php/7.4/fpm/pool.d/www.conf'
when '18.04'
'/etc/php/7.2/fpm/pool.d/www.conf'
when '16.04'
Expand Down
2 changes: 2 additions & 0 deletions spec/defines/extension_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '20.04'
'/etc/php/7.4/mods-available'
when '18.04'
'/etc/php/7.2/mods-available'
when '16.04'
Expand Down
2 changes: 2 additions & 0 deletions spec/defines/fpm_pool_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
let(:params) { {} }

case facts[:os]['release']['major']
when '20.04'
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'
Expand Down

0 comments on commit b850252

Please sign in to comment.