From 2a28bf2b8fd8ed112fee095434dc2e9762e518fa Mon Sep 17 00:00:00 2001 From: Tom Krouper Date: Tue, 3 Dec 2024 15:06:15 -0800 Subject: [PATCH 01/12] feat: add support for ubuntu 24.04 Signed-off-by: Tom Krouper --- .github/workflows/ci.yml | 7 ++ CHANGELOG.md | 4 +- README.md | 1 + kitchen.yml | 4 +- libraries/helpers.rb | 6 ++ .../apparmor/ubuntu-24.04/usr.sbin.mysqld.erb | 68 +++++++++++++++++++ 6 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 templates/default/apparmor/ubuntu-24.04/usr.sbin.mysqld.erb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c2db7724..6db008340 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,7 @@ jobs: - "ubuntu-1804" - "ubuntu-2004" - "ubuntu-2204" + - "ubuntu-2404" suite: - "client-install-57" - "client-install-80" @@ -68,6 +69,12 @@ jobs: suite: smoke57 - os: ubuntu-2204 suite: resources-57 + - os: ubuntu-2404 + suite: client-install-57 + - os: ubuntu-2404 + suite: smoke57 + - os: ubuntu-2404 + suite: resources-57 - os: rockylinux-8 suite: client-install-57 - os: rockylinux-8 diff --git a/CHANGELOG.md b/CHANGELOG.md index da8b67ca4..2779099cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. ## Unreleased +- feat: add support for ubuntu 24.04 (noble numbat) + ## 11.1.8 - *2024-11-18* ## 11.1.7 - *2024-11-18* @@ -659,7 +661,7 @@ Adding Ubuntu 13.04 to Platforminfo - **[COOK-2966] - Address foodcritic failures' - **[COOK-4182] - Template parse failure in /etc/init/mysql.conf (data_dir)' - **[COOK-4198] - Added missing tunable' -- **[COOK-4206] - create root@127.0.0.1, as well as root@localhost' +- **[COOK-4206] - create `root@127.0.0.1`, as well as `root@localhost`' ## [4.0.20] - 2014-01-18 diff --git a/README.md b/README.md index e527d5c24..d05e505df 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ The following platforms have been tested with Test Kitchen: | ubuntu-18.04 | | X | | | ubuntu-20.04 | | | X | | ubuntu-22.04 | | | X | +| ubuntu-24.04 | | | X | ## Cookbook Dependencies diff --git a/kitchen.yml b/kitchen.yml index 7c3440ad6..82bdd95e2 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -4,7 +4,7 @@ suse_dists_with_56 = %w(opensuse-leap-15) yum_dists_with_57 = %w(centos-7 fedora-latest) apt_dists_with_57 = %w(ubuntu-18.04) yum_dists_with_80 = %w(centos-7 centos-stream-8 almalinux-8 rockylinux-8 fedora-latest) -apt_dists_with_80 = %w(ubuntu-20.04) +apt_dists_with_80 = %w(ubuntu-20.04 ubuntu-22.04 ubuntu-24.04) %> --- driver: @@ -31,6 +31,8 @@ platforms: - name: rockylinux-8 - name: ubuntu-18.04 - name: ubuntu-20.04 + - name: ubuntu-22.04 + - name: ubuntu-24.04 suites: # diff --git a/libraries/helpers.rb b/libraries/helpers.rb index ad96fee62..17ecc8978 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -52,6 +52,11 @@ def jammy? false end + def noble? + return true if platform?('ubuntu') && node['platform_version'] == '24.04' + false + end + def defaults_file "#{etc_dir}/my.cnf" end @@ -85,6 +90,7 @@ def default_major_version return '5.7' if bionic? return '8.0' if focal? return '8.0' if jammy? + return '8.0' if noble? # misc return '5.6' if platform?('freebsd') diff --git a/templates/default/apparmor/ubuntu-24.04/usr.sbin.mysqld.erb b/templates/default/apparmor/ubuntu-24.04/usr.sbin.mysqld.erb new file mode 100644 index 000000000..2619e7d39 --- /dev/null +++ b/templates/default/apparmor/ubuntu-24.04/usr.sbin.mysqld.erb @@ -0,0 +1,68 @@ +# vim:syntax=apparmor +# Last Modified: Tue Feb 09 15:28:30 2016 +#include + +/usr/sbin/mysqld { + #include + #include + #include + #include + #include + +# Allow system resource access + /sys/devices/system/cpu/ r, + capability sys_resource, + capability dac_override, + capability setuid, + capability setgid, + +# Allow network access + network tcp, + + /etc/hosts.allow r, + /etc/hosts.deny r, + +# Allow config access + /etc/mysql/** r, + +# Allow pid, socket, socket lock file access + /var/run/mysqld/mysqld.pid rw, + /var/run/mysqld/mysqld.sock rw, + /var/run/mysqld/mysqld.sock.lock rw, + /run/mysqld/mysqld.pid rw, + /run/mysqld/mysqld.sock rw, + /run/mysqld/mysqld.sock.lock rw, + +# Allow execution of server binary + /usr/sbin/mysqld mr, + /usr/sbin/mysqld-debug mr, + +# Allow plugin access + /usr/lib/mysql/plugin/ r, + /usr/lib/mysql/plugin/*.so* mr, + +# Allow error msg and charset access + /usr/share/mysql/ r, + /usr/share/mysql/** r, + +# Allow data dir access + /var/lib/mysql/ r, + /var/lib/mysql/** rwk, + +# Allow data files dir access + /var/lib/mysql-files/ r, + /var/lib/mysql-files/** rwk, + +# Allow keyring dir access + /var/lib/mysql-keyring/ r, + /var/lib/mysql-keyring/** rwk, + +# Allow log file access + /var/log/mysql.err rw, + /var/log/mysql.log rw, + /var/log/mysql/ r, + /var/log/mysql/** rw, + + # Site-specific additions and overrides. See local/README for details. + #include +} From d52f356509f182b1eb6bf8404c8755dbb0bec662 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:14:33 +0000 Subject: [PATCH 02/12] chore(deps): update actionshub/chef-install action to v3.0.1 (#719) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6db008340..5371242e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,7 @@ jobs: - name: Check out code uses: actions/checkout@v4 - name: Install Chef - uses: actionshub/chef-install@3.0.0 + uses: actionshub/chef-install@3.0.1 # https://github.com/actions/virtual-environments/issues/181#issuecomment-610874237 - name: Disable apparmor for mysqld run: | From ea6dbcfc27e6a87a7bf0d418c4bb4c7f7db283bf Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 10 Dec 2024 00:14:37 +0800 Subject: [PATCH 03/12] Update changelog for 11.1.9 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2779099cd..5cf638894 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## Unreleased +## 11.1.9 - *2024-12-09* - feat: add support for ubuntu 24.04 (noble numbat) From 884022e47156b414a4588bf368e2cfb09a32af8a Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 10 Dec 2024 00:14:38 +0800 Subject: [PATCH 04/12] Update metadata for 11.1.9 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 63362bff7..a2ef61a3f 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/mysql' issues_url 'https://github.com/sous-chefs/mysql/issues' chef_version '>= 15.5' -version '11.1.8' +version '11.1.9' depends 'apparmor' From 6d00724af8893e40a1f73e8c956b30c4d34aa5da Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 10 Dec 2024 00:14:41 +0800 Subject: [PATCH 05/12] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cf638894..daf1fbedc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. +## Unreleased + ## 11.1.9 - *2024-12-09* - feat: add support for ubuntu 24.04 (noble numbat) From 2d4f2373822cfd277ce08efcd1c0f95febcd65d4 Mon Sep 17 00:00:00 2001 From: Tom Krouper Date: Mon, 9 Dec 2024 09:38:38 -0800 Subject: [PATCH 06/12] Add port to smoke test --- CHANGELOG.md | 4 ++-- test/cookbooks/test/recipes/smoke.rb | 4 ++-- test/cookbooks/test/templates/default/replication-slave.erb | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index daf1fbedc..b886e89c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,10 @@ All notable changes to this project will be documented in this file. ## Unreleased -## 11.1.9 - *2024-12-09* - - feat: add support for ubuntu 24.04 (noble numbat) +## 11.1.9 - *2024-12-09* + ## 11.1.8 - *2024-11-18* ## 11.1.7 - *2024-11-18* diff --git a/test/cookbooks/test/recipes/smoke.rb b/test/cookbooks/test/recipes/smoke.rb index 254c93368..e5d04857a 100644 --- a/test/cookbooks/test/recipes/smoke.rb +++ b/test/cookbooks/test/recipes/smoke.rb @@ -47,7 +47,7 @@ mysql_config 'replication-slave-1' do instance 'slave-1' source 'replication-slave.erb' - variables(server_id: '2', mysql_instance: 'slave-1') + variables(server_id: '2', mysql_instance: 'slave-1', port: '3307') notifies :restart, 'mysql_service[slave-1]', :immediately action :create end @@ -63,7 +63,7 @@ mysql_config 'replication-slave-2' do instance 'slave-2' source 'replication-slave.erb' - variables(server_id: '3', mysql_instance: 'slave-2') + variables(server_id: '3', mysql_instance: 'slave-2', port: '3308') notifies :restart, 'mysql_service[slave-2]', :immediately action :create end diff --git a/test/cookbooks/test/templates/default/replication-slave.erb b/test/cookbooks/test/templates/default/replication-slave.erb index 2b64f1c5f..01fe0ee0e 100644 --- a/test/cookbooks/test/templates/default/replication-slave.erb +++ b/test/cookbooks/test/templates/default/replication-slave.erb @@ -3,3 +3,4 @@ log_error = /var/log/mysql-<%= @mysql_instance %>/error.log relay-log = /var/log/mysql-<%= @mysql_instance %>/mysql-relay-bin.log server-id = <%= @server_id %> replicate-ignore-db = mysql +port = <%= @port || '3306' %> From 2b525d75b0e8972c38812f42a8510c034b8c6150 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 10 Dec 2024 00:14:37 +0800 Subject: [PATCH 07/12] Update changelog for 11.1.9 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b886e89c8..ea1d8e1b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## Unreleased +## 11.1.9 - *2024-12-09* - feat: add support for ubuntu 24.04 (noble numbat) From ee271f26d9a086da435c91ee1cb652508f23e192 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:55:06 -0800 Subject: [PATCH 08/12] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 +- test/cookbooks/test/recipes/smoke.rb | 4 ++-- test/cookbooks/test/templates/default/replication-slave.erb | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea1d8e1b1..b886e89c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## 11.1.9 - *2024-12-09* +## Unreleased - feat: add support for ubuntu 24.04 (noble numbat) diff --git a/test/cookbooks/test/recipes/smoke.rb b/test/cookbooks/test/recipes/smoke.rb index e5d04857a..254c93368 100644 --- a/test/cookbooks/test/recipes/smoke.rb +++ b/test/cookbooks/test/recipes/smoke.rb @@ -47,7 +47,7 @@ mysql_config 'replication-slave-1' do instance 'slave-1' source 'replication-slave.erb' - variables(server_id: '2', mysql_instance: 'slave-1', port: '3307') + variables(server_id: '2', mysql_instance: 'slave-1') notifies :restart, 'mysql_service[slave-1]', :immediately action :create end @@ -63,7 +63,7 @@ mysql_config 'replication-slave-2' do instance 'slave-2' source 'replication-slave.erb' - variables(server_id: '3', mysql_instance: 'slave-2', port: '3308') + variables(server_id: '3', mysql_instance: 'slave-2') notifies :restart, 'mysql_service[slave-2]', :immediately action :create end diff --git a/test/cookbooks/test/templates/default/replication-slave.erb b/test/cookbooks/test/templates/default/replication-slave.erb index 01fe0ee0e..2b64f1c5f 100644 --- a/test/cookbooks/test/templates/default/replication-slave.erb +++ b/test/cookbooks/test/templates/default/replication-slave.erb @@ -3,4 +3,3 @@ log_error = /var/log/mysql-<%= @mysql_instance %>/error.log relay-log = /var/log/mysql-<%= @mysql_instance %>/mysql-relay-bin.log server-id = <%= @server_id %> replicate-ignore-db = mysql -port = <%= @port || '3306' %> From 333d2380535d6f2179a27337a15f8417b43cf596 Mon Sep 17 00:00:00 2001 From: Tom Krouper Date: Tue, 10 Dec 2024 13:55:48 -0800 Subject: [PATCH 09/12] Temporary change to test what the access Access denied message is about --- test/cookbooks/test/recipes/smoke.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/cookbooks/test/recipes/smoke.rb b/test/cookbooks/test/recipes/smoke.rb index 254c93368..c6d815b7f 100644 --- a/test/cookbooks/test/recipes/smoke.rb +++ b/test/cookbooks/test/recipes/smoke.rb @@ -89,8 +89,9 @@ # Create user repl on master bash 'create replication user' do code <<-EOF - /usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -p#{Shellwords.escape(root_pass_master)} -D mysql -e "CREATE USER 'repl'@'127.0.0.1' IDENTIFIED BY 'REPLICAAATE';" - /usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -p#{Shellwords.escape(root_pass_master)} -D mysql -e "GRANT REPLICATION SLAVE ON *.* TO 'repl'@'127.0.0.1';" + MYSQL_PWD=#{Shellwords.escape(root_pass_master)} /usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -D mysql -e "CREATE USER 'repl'@'127.0.0.1' IDENTIFIED BY 'REPLICAAATE';" + MYSQL_PWD=#{Shellwords.escape(root_pass_master)} /usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -D mysql -e "GRANT REPLICATION SLAVE ON *.* TO 'repl'@'127.0.0.1';" + /usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -p#{Shellwords.escape(root_pass_master)} -e 'show grants' EOF not_if "/usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -p#{Shellwords.escape(root_pass_master)} -e 'select User,Host from mysql.user' | grep repl" action :run From 9404aba9b5b6c4f3353935ddba50163d5055dbb8 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 10 Dec 2024 00:14:37 +0800 Subject: [PATCH 10/12] Update changelog for 11.1.9 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b886e89c8..ea1d8e1b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## Unreleased +## 11.1.9 - *2024-12-09* - feat: add support for ubuntu 24.04 (noble numbat) From f7364d3d66e1b83340cdcd353825f698a9a11813 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 10 Dec 2024 00:14:41 +0800 Subject: [PATCH 11/12] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea1d8e1b1..d366636c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. +## Unreleased + ## 11.1.9 - *2024-12-09* - feat: add support for ubuntu 24.04 (noble numbat) From 06799bbb2ff73fee477f0fde44e2b868e5bbd3e5 Mon Sep 17 00:00:00 2001 From: Tom Krouper Date: Tue, 10 Dec 2024 20:18:24 -0800 Subject: [PATCH 12/12] More testing --- test/cookbooks/test/recipes/smoke.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/cookbooks/test/recipes/smoke.rb b/test/cookbooks/test/recipes/smoke.rb index c6d815b7f..953b11cf8 100644 --- a/test/cookbooks/test/recipes/smoke.rb +++ b/test/cookbooks/test/recipes/smoke.rb @@ -89,9 +89,10 @@ # Create user repl on master bash 'create replication user' do code <<-EOF - MYSQL_PWD=#{Shellwords.escape(root_pass_master)} /usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -D mysql -e "CREATE USER 'repl'@'127.0.0.1' IDENTIFIED BY 'REPLICAAATE';" - MYSQL_PWD=#{Shellwords.escape(root_pass_master)} /usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -D mysql -e "GRANT REPLICATION SLAVE ON *.* TO 'repl'@'127.0.0.1';" - /usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -p#{Shellwords.escape(root_pass_master)} -e 'show grants' + # MYSQL_PWD=#{Shellwords.escape(root_pass_master)} /usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -D mysql -e "CREATE USER 'repl'@'127.0.0.1' IDENTIFIED BY 'REPLICAAATE';" + # MYSQL_PWD=#{Shellwords.escape(root_pass_master)} /usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -D mysql -e "GRANT REPLICATION SLAVE ON *.* TO 'repl'@'127.0.0.1';" + MYSQL_PWD=ilikerandompasswords /usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -D mysql -e "CREATE USER 'repl'@'127.0.0.1' IDENTIFIED BY 'REPLICAAATE';" + MYSQL_PWD=ilikerandompasswords /usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -D mysql -e "GRANT REPLICATION SLAVE ON *.* TO 'repl'@'127.0.0.1';" EOF not_if "/usr/bin/mysql -u root -h 127.0.0.1 -P 3306 -p#{Shellwords.escape(root_pass_master)} -e 'select User,Host from mysql.user' | grep repl" action :run