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 ubuntu 24.04 support #659

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
11 changes: 10 additions & 1 deletion .github/workflows/test-kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
jobs:
kitchen:
name: Test Kitchen
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
permissions:
packages: read
strategy:
Expand Down Expand Up @@ -119,6 +119,7 @@ jobs:
- wiki
os:
- ubuntu-2204
- ubuntu-2404
include:
- os: ubuntu-2004
suite: mailman
Expand Down Expand Up @@ -179,6 +180,14 @@ jobs:
os: ubuntu-2204
- suite: web-rails
os: ubuntu-2204
- suite: mailman
os: ubuntu-2404
- suite: osqa
os: ubuntu-2404
- suite: otrs
os: ubuntu-2404
- suite: taginfo
os: ubuntu-2404
fail-fast: false
steps:
- name: Login to GitHub Container Registry
Expand Down
9 changes: 9 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ platforms:
- RUN /usr/bin/apt-get update -y
- RUN /usr/bin/apt-get install -y eatmydata
- RUN echo /usr/lib/$(uname -m)-linux-gnu/libeatmydata.so >>/etc/ld.so.preload
- name: ubuntu-24.04
driver:
image: ghcr.io/test-kitchen/dokken/ubuntu-24.04
privileged: true
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update -y
- RUN /usr/bin/apt-get install -y eatmydata
- RUN echo /usr/lib/$(uname -m)-linux-gnu/libeatmydata.so >>/etc/ld.so.preload
- name: debian-12
driver:
image: ghcr.io/test-kitchen/dokken/debian-12
Expand Down
1 change: 1 addition & 0 deletions cookbooks/backup/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
version "1.0.0"
supports "ubuntu"
depends "accounts"
depends "awscli"
2 changes: 1 addition & 1 deletion cookbooks/backup/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
#

include_recipe "accounts"
include_recipe "awscli"

package %w[
perl
libdate-calc-perl
awscli
]

directory "/store/backup" do
Expand Down
2 changes: 2 additions & 0 deletions cookbooks/chef/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

os_release = if platform?("debian") && node[:lsb][:release].to_f > 11
11
elsif platform?("ubuntu") && node[:lsb][:release].to_f > 22.04
22.04
else
node[:lsb][:release]
end
Expand Down
15 changes: 9 additions & 6 deletions cookbooks/clamav/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@
package %w[
clamav-daemon
clamav-freshclam
clamav-unofficial-sigs
]

template "/etc/clamav-unofficial-sigs.conf.d/50-chef.conf" do
source "clamav-unofficial-sigs.conf.erb"
owner "root"
group "root"
mode "644"
if platform?("ubuntu") && node[:lsb][:release].to_f < 24.04
package "clamav-unofficial-sigs"

template "/etc/clamav-unofficial-sigs.conf.d/50-chef.conf" do
source "clamav-unofficial-sigs.conf.erb"
owner "root"
group "root"
mode "644"
end
end

execute "freshclam" do
Expand Down
7 changes: 6 additions & 1 deletion cookbooks/elasticsearch/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
when "8.x" then include_recipe "apt::elasticsearch8"
end

package "default-jre-headless"
if node[:elasticsearch][:version] == "6.x"
package "openjdk-11-jre-headless"
else
package "default-jre-headless"
end

package "elasticsearch"

template "/etc/elasticsearch/elasticsearch.yml" do
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/fail2ban/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
ruby-webrick
]

if platform?("debian")
if platform?("debian") || (platform?("ubuntu") && node[:lsb][:release].to_f >= 24.04)
package "python3-inotify"
else
package "gamin"
Expand Down
16 changes: 11 additions & 5 deletions cookbooks/php/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
default[:php][:version] = if platform?("debian")
"8.2"
elsif node[:lsb][:release].to_f < 22.04
"7.4"
else
"8.1"
"8.2" # PHP version for Debian
elsif platform?("ubuntu")
case node[:lsb][:release].to_f
when 24.04
"8.3" # PHP version for Ubuntu 24.04
when 22.04
"8.1" # PHP version for Ubuntu 22.04
when 20.04
"7.4" # PHP version for Ubuntu 20.04
end
end

default[:php][:fpm][:options] = {}
16 changes: 11 additions & 5 deletions cookbooks/ruby/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
default[:ruby][:version] = if platform?("debian")
"3.1"
elsif node[:lsb][:release].to_f < 22.04
"2.7"
else
"3.0"
"3.1" # ruby version for Debian
elsif platform?("ubuntu")
case node[:lsb][:release].to_f
when 24.04
"3.2" # ruby version for Ubuntu 24.04
when 22.04
"3.0" # ruby version for Ubuntu 22.04
when 20.04
"2.7" # ruby version for Ubuntu 20.04
end
end

default[:ruby][:gem] = "/usr/bin/gem#{node[:ruby][:version]}"
default[:ruby][:bundle] = "/usr/bin/bundle#{node[:ruby][:version]}"
2 changes: 1 addition & 1 deletion cookbooks/spamassassin/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package "spamassassin"

service_name = if platform?("debian")
service_name = if platform?("debian") || (platform?("ubuntu") && node[:lsb][:release].to_f >= 24.04)
"spamd"
else
"spamassassin"
Expand Down
2 changes: 1 addition & 1 deletion test/integration/mail/inspec/spamassassin_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
service_name = if os.name == "debian"
service_name = if os.name == "debian" || (os.name == "ubuntu" && os.release.to_f >= 24.04)
"spamd"
else
"spamassassin"
Expand Down
4 changes: 3 additions & 1 deletion test/integration/openssh/inspec/openssh_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@

describe port(22) do
it { should be_listening }
its("protocols") { should cmp %w[tcp tcp6] }
its("protocols") { should include "tcp" }
# https://github.com/inspec/inspec/issues/3209
# its("protocols") { should include "tcp6" }
end
2 changes: 1 addition & 1 deletion test/integration/spamassassin/inspec/spamassassin_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
service_name = if os.name == "debian"
service_name = if os.name == "debian" || (os.name == "ubuntu" && os.release.to_f >= 24.04)
"spamd"
else
"spamassassin"
Expand Down
Loading