Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Debian 12 (bookworm) #687

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
'Debian' => $facts['os']['release']['major'] ? {
'10' => '7.3',
'11' => '7.4',
'12' => '8.2',
default => fail("Unsupported Debian release: ${fact('os.release.major')}"),
},
'Ubuntu' => $facts['os']['release']['major'] ? {
Expand Down Expand Up @@ -84,6 +85,9 @@
}
}
} else {
if $flavor == 'zend' and versioncmp($facts['os']['release']['major'], '11') > 0 {
fail("Zend PHP is unsupported on this Debian release: ${fact('os.release.major')}")
}
case $globals_php_version {
/^5\.6/,
/^7\.[0-9]/,
Expand Down
4 changes: 2 additions & 2 deletions manifests/repo/debian.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}
include 'apt'

if ($dotdeb and $facts['os']['release']['major'] in ['6', '7', '8']) {
if ($dotdeb and versioncmp($facts['os']['release']['major'], '9') < 1) {
apt::source { 'source_php_dotdeb':
location => $location,
repos => $repos,
Expand All @@ -50,7 +50,7 @@
}
}

if ($sury and $facts['os']['release']['major'] in ['9', '10', '11']) {
if ($sury and versioncmp($facts['os']['release']['major'], '9') >= 0) {
apt::source { 'source_php_sury':
location => 'https://packages.sury.org/php/',
repos => 'main',
Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"operatingsystem": "Debian",
"operatingsystemrelease": [
"10",
"11"
"11",
"12"
]
},
{
Expand Down
4 changes: 4 additions & 0 deletions spec/acceptance/php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
'php7.2-fpm'
when %r{debian-10}
'php7.3-fpm'
when %r{debian-12}
'php8.2-fpm'
else
'php-fpm'
end
Expand Down Expand Up @@ -64,7 +66,7 @@
apply_manifest(pp, catch_changes: true)
end
else
it 'works with defaults' do

Check failure on line 69 in spec/acceptance/php_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / - Archlinux rolling

php with default settings default parameters with extensions works with defaults Failure/Error: apply_manifest(pp, catch_failures: true) Beaker::Host::CommandFailure: Host 'archlinuxrolling-64-none.example.com' exited with 6 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_150251646.pp.yVFLuV Last 10 lines of output were: Info: Php::Config::Setting[/etc/php/conf.d/gd.ini: extension]: Scheduling refresh of Ini_setting[/etc/php/conf.d/gd.ini: extension] �[mNotice: /Stage[main]/Php/Php::Extension[intl]/Php::Extension::Config[intl]/Php::Config[intl]/Php::Config::Setting[/etc/php/conf.d/intl.ini: extension]/Ini_setting[/etc/php/conf.d/intl.ini: extension]: Dependency Package[php-intl] has failures: true Warning: /Stage[main]/Php/Php::Extension[intl]/Php::Extension::Config[intl]/Php::Config[intl]/Php::Config::Setting[/etc/php/conf.d/intl.ini: extension]/Ini_setting[/etc/php/conf.d/intl.ini: extension]: Skipping because of failed dependencies �[mNotice: /Stage[main]/Php/Php::Extension[gd]/Php::Extension::Config[gd]/Php::Config[gd]/Php::Config::Setting[/etc/php/conf.d/gd.ini: extension]/Ini_setting[/etc/php/conf.d/gd.ini: extension]/ensure: created �[mNotice: /Stage[main]/Php/Php::Extension[gd]/Php::Extension::Config[gd]/Php::Config[gd]/Php::Config::Setting[/etc/php/conf.d/gd.ini: extension]/Ini_setting[/etc/php/conf.d/gd.ini: extension]: Triggered 'refresh' from 1 event Info: Php::Extension[gd]: Scheduling refresh of Service[php-fpm] Warning: /Stage[main]/Php::Fpm::Service/Service[php-fpm]: Skipping because of failed dependencies Info: /Stage[main]/Php::Fpm::Service/Service[php-fpm]: Unscheduling all events on Service[php-fpm] Info: Class[Php]: Unscheduling all events on Class[Php] �[mNotice: Applied catalog in 4.96 seconds
pp = <<-EOS
class{ 'php':
extensions => {
Expand All @@ -88,6 +90,8 @@
'php7.2-fpm'
when %r{debian-10}
'php7.3-fpm'
when %r{debian-12}
'php8.2-fpm'
else
'php-fpm'
end
Expand Down
5 changes: 2 additions & 3 deletions spec/classes/php_repo_debian_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
if facts[:os]['name'] == 'Debian'
it { is_expected.to compile.with_all_deps }

case facts[:os]['release']['major']
when '6', '7', '8'
if facts[:os]['release']['major'].to_i < 9
it { is_expected.to contain_apt__source('source_php_dotdeb') }
it { is_expected.not_to contain_apt__source('source_php_sury') }
when '9', '10', '11'
elsif facts[:os]['release']['major'].to_i >= 9
it { is_expected.not_to contain_apt__source('source_php_dotdeb') }
it { is_expected.to contain_apt__source('source_php_sury') }
end
Expand Down
14 changes: 13 additions & 1 deletion spec/classes/php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
php_cli_package = case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
when '12'
'php8.2-cli'
when '11'
'php7.4-cli'
when '10'
Expand All @@ -34,6 +36,8 @@
php_fpm_package = case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
when '12'
'php8.2-fpm'
when '11'
'php7.4-fpm'
when '10'
Expand All @@ -56,6 +60,8 @@
php_dev_package = case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
when '12'
'php8.2-dev'
when '11'
'php7.4-dev'
when '10'
Expand Down Expand Up @@ -178,6 +184,8 @@
case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
when '12'
'/etc/php/8.2/fpm/pool.d/www.conf'
when '11'
'/etc/php/7.4/fpm/pool.d/www.conf'
when '10'
Expand Down Expand Up @@ -221,6 +229,8 @@
case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
when '12'
'/etc/php/8.2/fpm/pool.d/www.conf'
when '11'
'/etc/php/7.4/fpm/pool.d/www.conf'
when '10'
Expand Down Expand Up @@ -271,6 +281,8 @@
case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
when '12'
'/etc/php/8.2/fpm/pool.d/www.conf'
when '11'
'/etc/php/7.4/fpm/pool.d/www.conf'
when '10'
Expand Down Expand Up @@ -315,7 +327,7 @@
it { is_expected.not_to contain_class('php::composer') }
end

if facts[:osfamily] == 'RedHat' || facts[:osfamily] == 'CentOS' || facts[:osfamily] == 'Debian'
if facts[:osfamily] == 'RedHat' || facts[:osfamily] == 'CentOS' || facts[:os]['name'] == 'Ubuntu' || (facts[:os]['name'] == 'Debian' && facts[:os]['release']['major'].to_i < 12)
describe 'when called with flavor zend' do
zendphp_cli_package = case facts[:os]['name']
when 'Debian', 'Ubuntu'
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 @@ -14,6 +14,8 @@
etcdir = case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
when '12'
'/etc/php/8.2/mods-available'
when '11'
'/etc/php/7.4/mods-available'
when '10'
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 @@ -17,6 +17,8 @@
let(:params) { {} }

case facts[:os]['release']['major']
when '12'
it { is_expected.to contain_file('/etc/php/8.2/fpm/pool.d/unique-name.conf') }
when '11'
it { is_expected.to contain_file('/etc/php/7.4/fpm/pool.d/unique-name.conf') }
when '10'
Expand Down
Loading