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 Fedora 40 to testing matrix #278

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ jobs:
fail-fast: false
matrix:
os:
- centos-stream-9
- centos-stream-10
- centos-stream-9
- debian-12
- fedora-40
# needs DNF5 support in Chef. :)
# - fedora-41
- ubuntu-2204
- ubuntu-2404
- debian-12
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -50,6 +53,7 @@ jobs:
env:
CHEF_LICENSE: accept-no-persist
CHEF_VERSION: 18.6.14

shellcheck:
runs-on: ubuntu-latest
steps:
Expand Down
14 changes: 14 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ driver:
chef_version: <%= ENV['CHEF_VERSION'] || 'current' %>

platforms:
- name: fedora-40
driver:
image: dokken/fedora-40
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
# stub out /etc/fstab for fb_fstab
- RUN touch /etc/fstab
- name: fedora-41
driver:
image: dokken/fedora-41
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
# stub out /etc/fstab for fb_fstab
- RUN touch /etc/fstab
- name: centos-stream-9
driver:
image: dokken/centos-stream-9
Expand Down
8 changes: 4 additions & 4 deletions cookbooks/ci_fixes/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# older versions of rsyslog try to call close() on every _possible_ fd
# as limited by ulimit -n, which can take MINUTES to start. So drop this
# number for CI: https://github.com/rsyslog/rsyslog/issues/5158
if node.centos_max_version?(9)
if fedora_derived?
node.default['fb_limits']['*']['nofile'] = {
'hard' => '1024',
'soft' => '1024',
Expand All @@ -35,15 +35,15 @@
# telling syslog to look at its socket. Why this is an issue only
# on CentOS, I do not know
whyrun_safe_ruby_block 'ci fix for postfix/syslog' do
only_if { node.centos? }
only_if { fedora_derived? }
block do
node.default['fb_syslog']['rsyslog_additional_sockets'] = []
end
end

# create the certs the default apache looks at
execute 'create certs' do
only_if { node.centos? }
only_if { fedora_derived? }
command 'openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 ' +
'-nodes -out /etc/pki/tls/certs/localhost.crt ' +
'-keyout /etc/pki/tls/private/localhost.key ' +
Expand All @@ -54,7 +54,7 @@
# /run/systemd/notify, so tell the unit not to try
# why this seems to be issue on CentOS, I do not know
fb_systemd_override 'syslog-no-systemd' do
only_if { node.centos? }
only_if { fedora_derived? }
unit_name 'rsyslog.service'
content({
'Service' => {
Expand Down
16 changes: 8 additions & 8 deletions cookbooks/fb_apache/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

moddir = value_for_platform_family(
# will be a symlink to the right arch dir
'rhel' => '/etc/httpd/modules',
['rhel', 'fedora'] => '/etc/httpd/modules',
'debian' => '/usr/lib/apache2/modules',
)

Expand Down Expand Up @@ -51,7 +51,7 @@
}

case node['platform_family']
when 'rhel'
when 'rhel', 'fedora'
modules += [
'log_config',
'logio',
Expand Down Expand Up @@ -172,22 +172,22 @@
},
'module_packages' => {
'dav_svn' => value_for_platform_family(
'rhel' => 'mod_dav_svn',
['rhel', 'fedora'] => 'mod_dav_svn',
),
'ldap' => value_for_platform_family(
'rhel' => 'mod_ldap',
['rhel', 'fedora'] => 'mod_ldap',
),
'php5' => value_for_platform_family(
'rhel' => 'mod_php',
['rhel', 'fedora'] => 'mod_php',
),
'php7' => value_for_platform_family(
'rhel' => 'mod_php',
['rhel', 'fedora'] => 'mod_php',
),
'fcgid' => value_for_platform_family(
'rhel' => 'mod_fcgid',
['rhel', 'fedora'] => 'mod_fcgid',
),
'ssl' => value_for_platform_family(
'rhel' => 'mod_ssl',
['rhel', 'fedora'] => 'mod_ssl',
),
},
'mpm' => 'prefork',
Expand Down
4 changes: 2 additions & 2 deletions cookbooks/fb_apache/libraries/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def self.get_module_packages(mods, pkgs)

def self.base_packages(node)
node.value_for_platform_family(
'rhel' => ['httpd', 'mod_ssl'],
['rhel', 'fedora'] => ['httpd', 'mod_ssl'],
'debian' => ['apache2'],
)
end
Expand All @@ -102,7 +102,7 @@ def self.packages(node)

def self.service(node)
node.value_for_platform_family(
'rhel' => 'httpd',
['rhel', 'fedora'] => 'httpd',
'debian' => 'apache2',
)
end
Expand Down
16 changes: 8 additions & 8 deletions cookbooks/fb_apache/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

node.default['fb_apache']['module_packages']['wsgi'] =
case node['platform_family']
when 'rhel'
when 'rhel', 'fedora'
node['platform_version'].to_f >= 8 ? 'python3-mod_wsgi' : 'mod_wsgi'
when 'debian'
'libapache2-mod-wsgi-py3'
Expand All @@ -32,7 +32,7 @@
# rubocop:disable Chef/Style/UnnecessaryPlatformCaseStatement
node.default['fb_apache']['modules_mapping']['wsgi'] =
case node['platform_family']
when 'rhel'
when 'rhel', 'fedora'
node['platform_version'].to_f >= 8 ? 'mod_wsgi_python3.so' : 'mod_wsgi.so'
else
'mod_wsgi.so'
Expand All @@ -54,18 +54,18 @@
else
'2.4'
end
when 'rhel'
when 'rhel', 'fedora'
node['platform_version'].to_f >= 7.0 ? '2.4' : '2.2'
end

httpdir = value_for_platform_family(
'rhel' => '/etc/httpd',
['rhel', 'fedora'] => '/etc/httpd',
'debian' => '/etc/apache2',
)

confdir =
case node['platform_family']
when 'rhel'
when 'rhel', 'fedora'
"#{httpdir}/conf.d"
when 'debian'
case apache_version
Expand All @@ -77,13 +77,13 @@
end

sitesdir = value_for_platform_family(
'rhel' => confdir,
['rhel', 'fedora'] => confdir,
'debian' => "#{httpdir}/sites-enabled",
)

moddir =
case node['platform_family']
when 'rhel'
when 'rhel', 'fedora'
"#{httpdir}/conf.modules.d"
when 'debian'
case apache_version
Expand All @@ -95,7 +95,7 @@
end

sysconfig = value_for_platform_family(
'rhel' => '/etc/sysconfig/httpd',
['rhel', 'fedora'] => '/etc/sysconfig/httpd',
'debian' => '/etc/default/apache2',
)

Expand Down
2 changes: 1 addition & 1 deletion cookbooks/fb_apache/resources/verify_configs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
end.run_action(:create)

verify_cmd = value_for_platform_family(
'rhel' => "httpd -t -d #{tdir}",
['rhel', 'fedora'] => "httpd -t -d #{tdir}",
'debian' => "apachectl -t -d #{tdir}",
)
Chef::Log.debug("fb_apache: verify using #{verify_cmd}")
Expand Down
4 changes: 2 additions & 2 deletions cookbooks/fb_collectd/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# limitations under the License.
#

unless node.centos? || node.debian? || node.ubuntu?
fail 'fb_collectd is only supported on CentOS, Debian or Ubuntu.'
unless debian? || fedora_derived?
fail 'fb_collectd is only Fedora-based and Debian-based distros'
end

case node['platform_family']
Expand Down
2 changes: 2 additions & 0 deletions cookbooks/fb_dracut/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
source_url 'https://github.com/facebook/chef-cookbooks/'
version '0.1.0'
supports 'centos'
supports 'fedora'
supports 'rhel'
depends 'fb_helpers'
4 changes: 2 additions & 2 deletions cookbooks/fb_dracut/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# limitations under the License.
#

unless node.centos?
fail 'fb_dracut is only supported on CentOS.'
unless fedora_derived?
fail 'fb_dracut is only supported on Fedora-based distros.'
end

include_recipe 'fb_dracut::packages'
Expand Down
1 change: 1 addition & 0 deletions cookbooks/fb_ebtables/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
version '0.1.0'
supports 'centos'
supports 'fedora'
supports 'rhel'
depends 'fb_helpers'
4 changes: 2 additions & 2 deletions cookbooks/fb_ebtables/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# limitations under the License.
#

unless node.centos? || node.fedora?
fail 'fb_ebtables is only supported on CentOS and Fedora'
unless fedora_derived?
fail 'fb_ebtables is only supported on Fedora-based distros.'
end

package 'ebtables' do
Expand Down
4 changes: 2 additions & 2 deletions cookbooks/fb_hddtemp/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# limitations under the License.
#

unless node.debian? || node.ubuntu? || node.centos?
fail 'fb_hddtemp only supports Debian, Ubuntu and CentOS.'
unless debian? || fedora_derived?
fail 'fb_hddtemp is only Fedora-based and Debian-based distros'
end

package 'hddtemp' do
Expand Down
33 changes: 27 additions & 6 deletions cookbooks/fb_helpers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ Usage
Simply depend on this cookbook from your metadata.rb to get these methods in
your node.

* `node.os_max_version?(version, full=false)`
Compares the OS version (`node['platform_version']` with `version`) and
returns `true` if the OS version is, at most `version`. By default compares
*only* the *major version* (so `8.2 <= 8.1` because `8 <= 8`). For comparing
the full version set full=true.

* `node.os_min_version?(version, full=false)`
Compares the OS version (`node['platform_version']` with `version`) and
returns `true` if the OS version is, at least `version`. By default compares
*only* the *major version* (so `8.2 >= 8.1` because `8 >= 8`). For comparing
the full version set full=true.

Note that for special cases like 'rawhide' or 'sid', you should use the
OS-specific incarnation of this (e.g. `debian_min_full_version?`)

* `node.centos?`
Is CentOS

Expand All @@ -42,11 +57,13 @@ your node.
* `node.centos10?`
Is CentOS Stream 10

* `node.centos_max_version?(v)`
* `node.centos_max_version?(v, full=false)`
Is RHEL-compatible with a maximum version number of v
See os_max_version? for details

* `node.centos_min_version?(v)`
* `node.centos_min_version?(v, full=false)`
Is RHEL-compatible with a minimum version number of v
See os_min_version? for details

* `node.fedora?`
Is Fedora
Expand Down Expand Up @@ -114,11 +131,13 @@ your node.
* `node.redhat10?`
Is Redhat Enterprise Linux 10

* `node.rhel_max_version?(v)`
* `node.rhel_max_version?(v, full=false)`
Is Redhat Enterprise Linux with a maximum major version number of v
See os_max_version? for details.

* `node.rhel_min_version?(v)`
* `node.rhel_min_version?(v, full=false)`
Is Redhat Enterprise Linux with a minimum major version number of v
See os_min_version? for details.

* `node.rhel?`
Is Redhat Enterprise Linux
Expand Down Expand Up @@ -156,11 +175,13 @@ your node.
* `node.rhel_family?`
Is Redhat Enterprise Linux-compatible (eg CentOS, Oracle Linux, Rocky Linux)

* `node.el_max_version?(v)`
* `node.el_max_version?(v, full=false)`
Is RHEL-compatible with a maximum version number of v
See os_max_version? for details.

* `node.el_min_version?(v)`
* `node.el_min_version?(v, full=false)`
Is RHEL-compatible with a minimum version number of v
See os_min_version? for details.

* `node.debian?`
Is Debian
Expand Down
Loading