Skip to content

Commit

Permalink
Add support for Ubuntu 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
andrekeller committed Oct 22, 2024
1 parent 9c3cfb3 commit f029460
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
'18.04' => '7.2',
'20.04' => '7.4',
'22.04' => '8.1',
'24.04' => '8.3',
default => fail("Unsupported Ubuntu release: ${fact('os.release.major')}"),
},
default => '5.x',
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": [
"20.04",
"22.04"
"22.04",
"24.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 @@ -16,6 +16,8 @@
'php7.4-fpm'
when %r{ubuntu-22.04}
'php8.1-fpm'
when %r{ubuntu-24.04}
'php8.3-fpm'
when %r{ubuntu-18.04}
'php7.2-fpm'
when %r{debian-10}
Expand All @@ -37,9 +39,11 @@

context 'default parameters with extensions' do
case default[:platform]
when %r{ubuntu-22.04}, %r{ubuntu-20.04}, %r{ubuntu-18.04}
when %r{ubuntu-24.04}, %r{ubuntu-22.04}, %r{ubuntu-20.04}, %r{ubuntu-18.04}
it 'works with defaults' do
case default[:platform]
when %r{ubuntu-24.04}
simplexmlpackagename = 'php8.3-xml'
when %r{ubuntu-22.04}
simplexmlpackagename = 'php8.1-xml'
when %r{ubuntu-20.04}
Expand Down Expand Up @@ -86,6 +90,8 @@
'php7.4-fpm'
when %r{ubuntu-22.04}
'php8.1-fpm'
when %r{ubuntu-24.04}
'php8.3-fpm'
when %r{ubuntu-18.04}
'php7.2-fpm'
when %r{debian-10}
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/php_fpm_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
it { is_expected.to contain_service('php7.2-fpm').with_ensure('running') }
when '22.04'
it { is_expected.to contain_service('php8.1-fpm').with_ensure('running') }
when '24.04'
it { is_expected.to contain_service('php8.3-fpm').with_ensure('running') }
when '10'
it { is_expected.to contain_service('php7.3-fpm').with_ensure('running') }
when '20.04', '11'
Expand Down
3 changes: 3 additions & 0 deletions spec/classes/php_fpm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
when '22.04'
it { is_expected.to contain_package('php8.1-fpm').with_ensure('present') }
it { is_expected.to contain_service('php8.1-fpm').with_ensure('running') }
when '24.04'
it { is_expected.to contain_package('php8.3-fpm').with_ensure('present') }
it { is_expected.to contain_service('php8.3-fpm').with_ensure('running') }
when '20.04', '11'
it { is_expected.to contain_package('php7.4-fpm').with_ensure('present') }
it { is_expected.to contain_service('php7.4-fpm').with_ensure('running') }
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 @@ -23,6 +23,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '24.04'
'php8.3-cli'
when '22.04'
'php8.1-cli'
when '20.04'
Expand All @@ -47,6 +49,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '24.04'
'php8.3-fpm'
when '22.04'
'php8.1-fpm'
when '20.04'
Expand All @@ -71,6 +75,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '24.04'
'php8.3-dev'
when '22.04'
'php8.1-dev'
when '20.04'
Expand Down Expand Up @@ -195,6 +201,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '24.04'
'/etc/php/8.3/fpm/pool.d/www.conf'
when '22.04'
'/etc/php/8.1/fpm/pool.d/www.conf'
when '20.04'
Expand Down Expand Up @@ -240,6 +248,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '24.04'
'/etc/php/8.3/fpm/pool.d/www.conf'
when '22.04'
'/etc/php/8.1/fpm/pool.d/www.conf'
when '20.04'
Expand Down Expand Up @@ -292,6 +302,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '24.04'
'/etc/php/8.3/fpm/pool.d/www.conf'
when '22.04'
'/etc/php/8.1/fpm/pool.d/www.conf'
when '20.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 @@ -25,6 +25,8 @@
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '24.04'
'/etc/php/8.3/mods-available'
when '22.04'
'/etc/php/8.1/mods-available'
when '20.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 @@ -33,6 +33,8 @@
let(:params) { {} }

case facts[:os]['release']['major']
when '24.04'
it { is_expected.to contain_file('/etc/php/8.3/fpm/pool.d/unique-name.conf') }
when '22.04'
it { is_expected.to contain_file('/etc/php/8.1/fpm/pool.d/unique-name.conf') }
when '20.04'
Expand Down

0 comments on commit f029460

Please sign in to comment.