From 6ae260c9d077e30d1958fc48eab8427d8c3d7737 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Mon, 31 Aug 2020 16:21:26 -0400 Subject: [PATCH] Add support for Ubuntu 20.04 (PHP 7.4) Signed-off-by: Simon Deziel --- .sync.yml | 3 +++ .travis.yml | 5 +++++ manifests/globals.pp | 1 + metadata.json | 3 ++- spec/acceptance/php_spec.rb | 8 +++++++- spec/classes/php_spec.rb | 12 ++++++++++++ spec/defines/extension_spec.rb | 2 ++ spec/defines/fpm_pool_spec.rb | 2 ++ 8 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.sync.yml b/.sync.yml index 85de9bb4..cb3729c9 100644 --- a/.sync.yml +++ b/.sync.yml @@ -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' diff --git a/.travis.yml b/.travis.yml index 017ebab9..2f26976e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/manifests/globals.pp b/manifests/globals.pp index f3b46706..351b2041 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -31,6 +31,7 @@ default => '7.3', }, 'Ubuntu' => $facts['os']['release']['major'] ? { + '20.04' => '7.4', '16.04' => '7.0', default => '7.2', }, diff --git a/metadata.json b/metadata.json index ac49eac4..4ee2c025 100644 --- a/metadata.json +++ b/metadata.json @@ -41,7 +41,8 @@ "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "16.04", - "18.04" + "18.04", + "20.04" ] }, { diff --git a/spec/acceptance/php_spec.rb b/spec/acceptance/php_spec.rb index 95427df8..888af45b 100644 --- a/spec/acceptance/php_spec.rb +++ b/spec/acceptance/php_spec.rb @@ -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} @@ -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} @@ -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} diff --git a/spec/classes/php_spec.rb b/spec/classes/php_spec.rb index 4d0f065c..135626a4 100644 --- a/spec/classes/php_spec.rb +++ b/spec/classes/php_spec.rb @@ -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' @@ -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' @@ -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' @@ -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' @@ -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' @@ -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' diff --git a/spec/defines/extension_spec.rb b/spec/defines/extension_spec.rb index 66c2e859..2278c6fd 100644 --- a/spec/defines/extension_spec.rb +++ b/spec/defines/extension_spec.rb @@ -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' diff --git a/spec/defines/fpm_pool_spec.rb b/spec/defines/fpm_pool_spec.rb index 7816c4ab..1deca1ae 100644 --- a/spec/defines/fpm_pool_spec.rb +++ b/spec/defines/fpm_pool_spec.rb @@ -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'