Skip to content

Commit eb97c57

Browse files
authored
Add missing fedora parts (#362)
Update cicd testing Signed-off-by: Mike van Goor <[email protected]>
1 parent 9f99d8d commit eb97c57

File tree

7 files changed

+34
-29
lines changed

7 files changed

+34
-29
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
os:
2626
- almalinux-8
2727
- almalinux-9
28-
- centos-stream-8
2928
- centos-stream-9
3029
- debian-11
3130
- debian-12
31+
- fedora-latest
3232
- rockylinux-8
3333
- rockylinux-9
3434
- ubuntu-2004

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ This file is used to list changes made in each version of the PHP cookbook.
44

55
## Unreleased
66

7+
- Support fedora platform
8+
- Update cicd platforms because of EOL
9+
710
## 10.0.3 - *2024-07-29*
811

912
Standardise files with files in sous-chefs/repo-management

kitchen.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ verifier:
1515

1616
platforms:
1717
- name: almalinux-8
18-
- name: amazonlinux-2
19-
- name: centos-7
20-
- name: centos-stream-8
21-
- name: debian-10
18+
- name: almalinux-9
19+
- name: amazonlinux-2023
20+
- name: centos-stream-9
2221
- name: debian-11
22+
- name: debian-12
23+
- name: fedora-latest
24+
- name: rockylinux-8
25+
- name: rockylinux-9
2326
- name: ubuntu-20.04
2427
- name: ubuntu-22.04
25-
- name: rockylinux-8
28+
- name: ubuntu-24.04
2629

2730
suites:
2831
- name: resource

libraries/helpers.rb

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Php
22
module Cookbook
33
module Helpers
44
def php_conf_dir
5-
if platform_family?('rhel', 'amazon')
5+
if platform_family?('rhel', 'amazon', 'fedora')
66
'/etc'
77
else
88
"/etc/php/#{php_version}/cli"
@@ -18,7 +18,7 @@ def php_enable_mod
1818
end
1919

2020
def php_ext_conf_dir
21-
if platform_family?('rhel', 'amazon')
21+
if platform_family?('rhel', 'amazon', 'fedora')
2222
'/etc/php.d'
2323
else
2424
"/etc/php/#{php_version}/mods-available"
@@ -30,58 +30,55 @@ def php_ext_dir
3030
end
3131

3232
def php_fpm_conf_dir
33-
if platform_family?('rhel', 'amazon')
33+
if platform_family?('rhel', 'amazon', 'fedora')
3434
'/etc/php-fpm.d'
3535
else
3636
"/etc/php/#{php_version}/fpm"
3737
end
3838
end
3939

4040
def php_fpm_default_conf
41-
if platform_family?('rhel', 'amazon')
41+
if platform_family?('rhel', 'amazon', 'fedora')
4242
'/etc/php-fpm.d/www.conf'
4343
else
4444
"/etc/php/#{php_version}/fpm/pool.d/www.conf"
4545
end
4646
end
4747

4848
def php_fpm_group
49-
case node['platform_family']
50-
when 'rhel', 'amazon'
49+
if platform_family?('rhel', 'amazon', 'fedora')
5150
'apache'
52-
when 'debian'
51+
else
5352
'www-data'
5453
end
5554
end
5655

5756
def php_fpm_listen_group
58-
case node['platform_family']
59-
when 'rhel', 'amazon'
57+
if platform_family?('rhel', 'amazon', 'fedora')
6058
'apache'
61-
when 'debian'
59+
else
6260
'www-data'
6361
end
6462
end
6563

6664
def php_fpm_listen_user
67-
case node['platform_family']
68-
when 'rhel', 'amazon'
65+
if platform_family?('rhel', 'amazon', 'fedora')
6966
'apache'
70-
when 'debian'
67+
else
7168
'www-data'
7269
end
7370
end
7471

7572
def php_fpm_package
76-
if platform_family?('rhel', 'amazon')
73+
if platform_family?('rhel', 'amazon', 'fedora')
7774
'php-fpm'
7875
else
7976
"php#{php_version}-fpm"
8077
end
8178
end
8279

8380
def php_fpm_pool_dir
84-
if platform_family?('rhel', 'amazon')
81+
if platform_family?('rhel', 'amazon', 'fedora')
8582
'/etc/php-fpm.d'
8683
else
8784
"/etc/php/#{php_version}/fpm/pool.d"
@@ -93,26 +90,25 @@ def php_fpm_pool_template
9390
end
9491

9592
def php_fpm_service
96-
if platform_family?('rhel', 'amazon')
93+
if platform_family?('rhel', 'amazon', 'fedora')
9794
'php-fpm'
9895
else
9996
"php#{php_version}-fpm"
10097
end
10198
end
10299

103100
def php_fpm_socket
104-
if platform_family?('rhel', 'amazon')
101+
if platform_family?('rhel', 'amazon', 'fedora')
105102
"/var/run/php#{php_version}-fpm.sock"
106103
else
107104
"/var/run/php/php#{php_version}-fpm.sock"
108105
end
109106
end
110107

111108
def php_fpm_user
112-
case node['platform_family']
113-
when 'rhel', 'amazon'
109+
if platform_family?('rhel', 'amazon', 'fedora')
114110
'apache'
115-
when 'debian'
111+
else
116112
'www-data'
117113
end
118114
end
@@ -123,7 +119,7 @@ def php_ini_template
123119

124120
def php_installation_packages
125121
case node['platform_family']
126-
when 'rhel'
122+
when 'rhel', 'fedora'
127123
%w(php php-devel php-cli php-pear)
128124
# Sometimes Amazon will default to different versions for each package,
129125
# so versions are pinned here to avoid packages getting ahead of each
@@ -152,6 +148,8 @@ def php_version
152148
else
153149
'7.2'
154150
end
151+
when 'fedora'
152+
'8.3'
155153
when 'amazon'
156154
'8.2'
157155
when 'debian'

metadata.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
supports 'amazon', '>= 2.0'
1212
supports 'centos', '>= 7.0'
1313
supports 'debian', '>= 10.0'
14+
supports 'fedora', '>= 39'
1415
supports 'oracle', '>= 7.0'
1516
supports 'redhat', '>= 7.0'
1617
supports 'scientific', '>= 7.0'

test/cookbooks/test/recipes/community.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
apt_update 'update'
1010

1111
# Start of the old community_package recipe ---
12-
if platform_family?('rhel')
12+
if platform_family?('rhel', 'fedora')
1313
include_recipe 'yum-remi-chef::remi'
1414
elsif platform?('ubuntu')
1515
# ondrej no longer supports Ubuntu <20.04

test/integration/resource/inspec/php_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
its('exit_status') { should eq 0 }
1212
end
1313

14-
unless os[:family] == 'redhat'
14+
unless os[:family] == 'redhat' || os[:family] == 'fedora'
1515
describe command('php -i') do
1616
its('stdout') { should match(/50-sync/) }
1717
end

0 commit comments

Comments
 (0)