From 8c1678ac9a0e90c2995f16e5044faa1becc3ad16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leandro=20Alves=20Magalh=C3=A3es=20dos=20Santos?= Date: Wed, 23 Aug 2023 13:01:04 -0300 Subject: [PATCH] feat: add support for ubuntu 22.04 (#685) * feat: add support for ubuntu 22.04 * docs: update changelog * docs: update link in readme * fix: corrected name for supports * feat: add ubuntu 22.04 integration * Fix Changelog Signed-off-by: Lance Albertson --------- Signed-off-by: Lance Albertson Co-authored-by: Jason Field Co-authored-by: Lance Albertson --- .github/workflows/ci.yml | 7 ++ CHANGELOG.md | 6 ++ README.md | 3 +- libraries/helpers.rb | 6 ++ metadata.rb | 2 +- .../apparmor/ubuntu-22.04/usr.sbin.mysqld.erb | 68 +++++++++++++++++++ 6 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 templates/default/apparmor/ubuntu-22.04/usr.sbin.mysqld.erb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 332b1ada2..5169ba0ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,7 @@ jobs: - "rockylinux-8" - "ubuntu-1804" - "ubuntu-2004" + - "ubuntu-2204" suite: - "client-install-57" - "client-install-80" @@ -61,6 +62,12 @@ jobs: suite: smoke57 - os: ubuntu-2004 suite: resources-57 + - os: ubuntu-2204 + suite: client-install-57 + - os: ubuntu-2204 + suite: smoke57 + - os: ubuntu-2204 + suite: resources-57 - os: rockylinux-8 suite: client-install-57 - os: rockylinux-8 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7475f35e0..dbdb57baa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,16 @@ All notable changes to this project will be documented in this file. ## Unreleased +- feat: add support for ubuntu 22.04 + ## 11.0.15 - *2023-07-10* +- Update sous-chefs/.github action to v2.0.5 + ## 11.0.14 - *2023-05-17* +- Update sous-chefs/.github action to v2.0.4 + ## 11.0.13 - *2023-04-04* Standardise files with files in sous-chefs/repo-management diff --git a/README.md b/README.md index e74f8884b..e527d5c24 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ The following platforms have been tested with Test Kitchen: | openSUSE Leap | X | | | | ubuntu-18.04 | | X | | | ubuntu-20.04 | | | X | +| ubuntu-22.04 | | | X | ## Cookbook Dependencies @@ -199,7 +200,7 @@ end Use multiple `mysql_service` instances to test a replication setup. This particular example serves as a smoke test in Test Kitchen because it exercises different resources and requires service restarts. - + ## Frequently Asked Questions diff --git a/libraries/helpers.rb b/libraries/helpers.rb index 6273813fe..ad96fee62 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -47,6 +47,11 @@ def focal? false end + def jammy? + return true if platform?('ubuntu') && node['platform_version'] == '22.04' + false + end + def defaults_file "#{etc_dir}/my.cnf" end @@ -79,6 +84,7 @@ def default_major_version return '5.7' if xenial? return '5.7' if bionic? return '8.0' if focal? + return '8.0' if jammy? # misc return '5.6' if platform?('freebsd') diff --git a/metadata.rb b/metadata.rb index 28f0dfd85..b3d508774 100644 --- a/metadata.rb +++ b/metadata.rb @@ -10,7 +10,7 @@ depends 'apparmor' -suppots 'redhat', '>= 7.0' +supports 'redhat', '>= 7.0' supports 'centos', '>= 7.0' supports 'scientific', '>= 7.0' supports 'oracle', '>= 7.0' diff --git a/templates/default/apparmor/ubuntu-22.04/usr.sbin.mysqld.erb b/templates/default/apparmor/ubuntu-22.04/usr.sbin.mysqld.erb new file mode 100644 index 000000000..2619e7d39 --- /dev/null +++ b/templates/default/apparmor/ubuntu-22.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 +}