From 5d05e5346c85b60cae5c1d3e129c9226ca6b7134 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 22 Apr 2024 13:48:22 +0100 Subject: [PATCH 1/9] Add ubuntu 24.04 to test-kitchen --- .kitchen.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.kitchen.yml b/.kitchen.yml index 0af8c80de..0ecb1dddf 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -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 From 9c36c0032b626eccfa97eb0eef3f1ecf3fc9f698 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 22 Apr 2024 13:49:20 +0100 Subject: [PATCH 2/9] Add ubuntu 24.04 versions --- cookbooks/fail2ban/recipes/default.rb | 2 +- cookbooks/php/attributes/default.rb | 16 +++++++++++----- cookbooks/ruby/attributes/default.rb | 16 +++++++++++----- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/cookbooks/fail2ban/recipes/default.rb b/cookbooks/fail2ban/recipes/default.rb index 216572989..97b54c48c 100644 --- a/cookbooks/fail2ban/recipes/default.rb +++ b/cookbooks/fail2ban/recipes/default.rb @@ -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" diff --git a/cookbooks/php/attributes/default.rb b/cookbooks/php/attributes/default.rb index 5dd05a52b..8b2b17d2e 100644 --- a/cookbooks/php/attributes/default.rb +++ b/cookbooks/php/attributes/default.rb @@ -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] = {} diff --git a/cookbooks/ruby/attributes/default.rb b/cookbooks/ruby/attributes/default.rb index eefaf2247..14bb604f5 100644 --- a/cookbooks/ruby/attributes/default.rb +++ b/cookbooks/ruby/attributes/default.rb @@ -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]}" From 10ddd6643812636891f3fad8e1314f2aaa568d2f Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 22 Apr 2024 18:34:17 +0100 Subject: [PATCH 3/9] chef: hardcode ubuntu 24.04 release for now --- cookbooks/chef/recipes/default.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cookbooks/chef/recipes/default.rb b/cookbooks/chef/recipes/default.rb index a27b99cbd..f024098a6 100644 --- a/cookbooks/chef/recipes/default.rb +++ b/cookbooks/chef/recipes/default.rb @@ -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 From 128f224a284250e479894b793807986a9b0b2f62 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 22 Apr 2024 18:34:56 +0100 Subject: [PATCH 4/9] clamav: clamav-unofficial-sigs only available for older releases --- cookbooks/clamav/recipes/default.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cookbooks/clamav/recipes/default.rb b/cookbooks/clamav/recipes/default.rb index 938b2f5ab..7d07d73ac 100644 --- a/cookbooks/clamav/recipes/default.rb +++ b/cookbooks/clamav/recipes/default.rb @@ -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 From 0fecae73f1a05971c89f08974a63d65d04e39919 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Tue, 23 Apr 2024 11:24:25 +0100 Subject: [PATCH 5/9] GHA run tests against Ubuntu 24.04 --- .github/workflows/test-kitchen.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index c079240cc..2f7253ad6 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -12,7 +12,7 @@ concurrency: jobs: kitchen: name: Test Kitchen - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest permissions: packages: read strategy: @@ -119,6 +119,7 @@ jobs: - wiki os: - ubuntu-2204 + - ubuntu-2404 include: - os: ubuntu-2004 suite: mailman @@ -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 From ff7466e6cc253b94ed0187fa0a0000050c770206 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Tue, 23 Apr 2024 11:34:01 +0100 Subject: [PATCH 6/9] backup: Use awscli cookbook --- cookbooks/backup/metadata.rb | 1 + cookbooks/backup/recipes/default.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cookbooks/backup/metadata.rb b/cookbooks/backup/metadata.rb index d5baa1664..c35950e0a 100644 --- a/cookbooks/backup/metadata.rb +++ b/cookbooks/backup/metadata.rb @@ -7,3 +7,4 @@ version "1.0.0" supports "ubuntu" depends "accounts" +depends "awscli" diff --git a/cookbooks/backup/recipes/default.rb b/cookbooks/backup/recipes/default.rb index 64e63fdee..6bf5c7ae9 100644 --- a/cookbooks/backup/recipes/default.rb +++ b/cookbooks/backup/recipes/default.rb @@ -18,11 +18,11 @@ # include_recipe "accounts" +include_recipe "awscli" package %w[ perl libdate-calc-perl - awscli ] directory "/store/backup" do From 10f94c214f046c40a10d1a826e15790f24aa1a4c Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 29 Jul 2024 16:52:50 +0100 Subject: [PATCH 7/9] spamassassin: Use correct daemon name on Ubuntu 24.04 --- cookbooks/spamassassin/recipes/default.rb | 2 +- test/integration/mail/inspec/spamassassin_spec.rb | 2 +- test/integration/spamassassin/inspec/spamassassin_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cookbooks/spamassassin/recipes/default.rb b/cookbooks/spamassassin/recipes/default.rb index db498b75f..4225b9fd3 100644 --- a/cookbooks/spamassassin/recipes/default.rb +++ b/cookbooks/spamassassin/recipes/default.rb @@ -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" diff --git a/test/integration/mail/inspec/spamassassin_spec.rb b/test/integration/mail/inspec/spamassassin_spec.rb index 18506eaa0..2b14c3962 100644 --- a/test/integration/mail/inspec/spamassassin_spec.rb +++ b/test/integration/mail/inspec/spamassassin_spec.rb @@ -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" diff --git a/test/integration/spamassassin/inspec/spamassassin_spec.rb b/test/integration/spamassassin/inspec/spamassassin_spec.rb index 18506eaa0..2b14c3962 100644 --- a/test/integration/spamassassin/inspec/spamassassin_spec.rb +++ b/test/integration/spamassassin/inspec/spamassassin_spec.rb @@ -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" From b1c02fa4657f1d4e28dc5642f53ecc3edc00bb88 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Wed, 7 Aug 2024 00:26:37 +0100 Subject: [PATCH 8/9] Use openjdk-11 with elasticsearch 6.x --- cookbooks/elasticsearch/recipes/default.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cookbooks/elasticsearch/recipes/default.rb b/cookbooks/elasticsearch/recipes/default.rb index a48ee9987..0c4be4071 100644 --- a/cookbooks/elasticsearch/recipes/default.rb +++ b/cookbooks/elasticsearch/recipes/default.rb @@ -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 From 2591006cb70f3a4c4e95f87d5ad135285cff7f27 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Wed, 7 Aug 2024 20:04:04 +0100 Subject: [PATCH 9/9] Workaround inspec tcp6 protocol detection bug --- test/integration/openssh/inspec/openssh_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/integration/openssh/inspec/openssh_spec.rb b/test/integration/openssh/inspec/openssh_spec.rb index 6560895eb..b135057d7 100644 --- a/test/integration/openssh/inspec/openssh_spec.rb +++ b/test/integration/openssh/inspec/openssh_spec.rb @@ -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