Skip to content

Commit 3bbd21d

Browse files
committed
feat: modernise cookbook structure and ChefSpec
- Add frozen_string_literal: true to all Ruby files - Add provides declarations to all resources - Rename spec/unit/recipes/ to spec/unit/resources/ - Fix almalinux/10 fauxhai spec (use platform override instead of unbundled platform) - Expand metadata.rb platform support (almalinux, rocky, oracle, fedora) - Add default kitchen suite with test recipe and InSpec profile - Align CI matrix with kitchen platforms and suites - Add LIMITATIONS.md documenting known constraints
1 parent 0027dcb commit 3bbd21d

38 files changed

+303
-80
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,31 @@ jobs:
2222
strategy:
2323
matrix:
2424
os:
25+
- "almalinux-8"
26+
- "almalinux-9"
27+
- "almalinux-10"
28+
- "centos-stream-9"
29+
- "centos-stream-10"
2530
- "debian-11"
2631
- "debian-12"
32+
- "fedora-latest"
33+
- "opensuse-leap-15"
34+
- "oraclelinux-8"
35+
- "oraclelinux-9"
36+
- "rockylinux-8"
37+
- "rockylinux-9"
2738
- "ubuntu-2004"
2839
- "ubuntu-2204"
29-
- "centos-stream-9"
30-
- "centos-stream-10"
31-
- "fedora-latest"
40+
- "ubuntu-2404"
3241
suite:
33-
- config-2
34-
# - config-3
35-
- config-acl
36-
- config-array
37-
- config-backend-search
38-
- config-custom-template
39-
- config-fastcgi
40-
- config-resolver
41-
- config-ssl-redirect
42+
- "default"
4243
- "package"
4344
- "source-24"
4445
- "source-26"
4546
- "source-28"
46-
- "source-lua"
4747
- "source-default"
4848
# - "source-openssl"
49-
# OpenSSSL libraries are not currently compiling correctly
49+
# OpenSSL libraries are not currently compiling correctly
5050
# see https://github.com/sous-chefs/haproxy/issues/503
5151
fail-fast: false
5252

@@ -72,6 +72,7 @@ jobs:
7272
os:
7373
- "amazonlinux-2023"
7474
suite:
75+
- "default"
7576
- "package"
7677
- "source-24"
7778
- "source-26"
@@ -83,17 +84,17 @@ jobs:
8384
- name: Check out code
8485
uses: actions/checkout@v5
8586
- name: Install Chef
86-
uses: actionshub/chef-install@3.0.1
87+
uses: actionshub/chef-install@main
8788
- name: Dokken
88-
uses: actionshub/test-kitchen@3.0.0
89+
uses: actionshub/test-kitchen@main
8990
env:
9091
CHEF_LICENSE: accept-no-persist
9192
KITCHEN_LOCAL_YAML: kitchen.dokken.yml
9293
with:
9394
suite: ${{ matrix.suite }}
9495
os: ${{ matrix.os }}
9596

96-
lua_test:
97+
lua-test:
9798
needs: lint-unit
9899
runs-on: ubuntu-latest
99100
strategy:
@@ -108,17 +109,17 @@ jobs:
108109
- name: Check out code
109110
uses: actions/checkout@v5
110111
- name: Install Chef
111-
uses: actionshub/chef-install@3.0.1
112+
uses: actionshub/chef-install@main
112113
- name: Dokken
113-
uses: actionshub/test-kitchen@3.0.0
114+
uses: actionshub/test-kitchen@main
114115
env:
115116
CHEF_LICENSE: accept-no-persist
116117
KITCHEN_LOCAL_YAML: kitchen.dokken.yml
117118
with:
118119
suite: ${{ matrix.suite }}
119120
os: ${{ matrix.os }}
120121

121-
configtest:
122+
config-test:
122123
needs: lint-unit
123124
runs-on: ubuntu-latest
124125
strategy:
@@ -128,23 +129,22 @@ jobs:
128129
suite:
129130
- "config-2"
130131
# - "config-3"
131-
- "config-backend-search"
132132
- "config-acl"
133-
- "config-resolver"
134-
- "config-ssl-redirect"
135-
- "config-custom-template"
136-
- "config-custom-template"
137133
- "config-array"
134+
- "config-backend-search"
135+
- "config-custom-template"
138136
- "config-fastcgi"
137+
- "config-resolver"
138+
- "config-ssl-redirect"
139139
fail-fast: false
140140

141141
steps:
142142
- name: Check out code
143143
uses: actions/checkout@v5
144144
- name: Install Chef
145-
uses: actionshub/chef-install@3.0.1
145+
uses: actionshub/chef-install@main
146146
- name: Dokken
147-
uses: actionshub/test-kitchen@3.0.0
147+
uses: actionshub/test-kitchen@main
148148
env:
149149
CHEF_LICENSE: accept-no-persist
150150
KITCHEN_LOCAL_YAML: kitchen.dokken.yml

Berksfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
source 'https://supermarket.chef.io'
24

35
metadata

LIMITATIONS.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Limitations
2+
3+
## Package Availability
4+
5+
HAProxy is available as a package on all major Linux distributions. The version
6+
available depends on the distribution release.
7+
8+
### APT (Debian/Ubuntu)
9+
10+
- **Debian 11 (Bullseye)**: HAProxy 2.2 (default), 2.4–2.8 via haproxy.debian.net
11+
- **Debian 12 (Bookworm)**: HAProxy 2.6 (default), 2.8–3.0 via haproxy.debian.net
12+
- **Ubuntu 20.04 (Focal)**: HAProxy 2.0 (default), newer via PPA `ppa:vbernat/haproxy-X.Y`
13+
- **Ubuntu 22.04 (Jammy)**: HAProxy 2.4 (default), newer via PPA
14+
- **Ubuntu 24.04 (Noble)**: HAProxy 2.8 (default), newer via PPA
15+
16+
Architectures: amd64, arm64, i386 (varies by release).
17+
18+
### DNF/YUM (RHEL family)
19+
20+
- **RHEL 8 / AlmaLinux 8 / Rocky 8 / Oracle 8**: HAProxy 1.8 (base), newer via EPEL or AppStream
21+
- **RHEL 9 / AlmaLinux 9 / Rocky 9 / Oracle 9**: HAProxy 2.4 (AppStream)
22+
- **AlmaLinux 10 / CentOS Stream 10**: HAProxy 3.0+ (AppStream)
23+
- **CentOS Stream 9**: HAProxy 2.4 (AppStream)
24+
- **Amazon Linux 2023**: HAProxy 2.8 (default repos)
25+
- **Fedora**: Latest stable (default repos)
26+
27+
Architectures: x86_64, aarch64.
28+
29+
EPEL is required for RHEL-family platforms when the base/AppStream version is insufficient.
30+
The `yum-epel` cookbook dependency handles this.
31+
32+
### Zypper (SUSE)
33+
34+
- **openSUSE Leap 15**: HAProxy 2.x (default repos)
35+
36+
Architectures: x86_64.
37+
38+
## Source/Compiled Installation
39+
40+
HAProxy can be compiled from source on all supported platforms. The cookbook supports
41+
source installation with configurable version, build flags, and optional features
42+
(Lua, OpenSSL, PCRE, Prometheus exporter).
43+
44+
### Build Dependencies
45+
46+
| Platform Family | Packages |
47+
|-----------------|-----------------------------------------------------------------------|
48+
| Debian | build-essential, libpcre3-dev, libssl-dev, zlib1g-dev, libsystemd-dev |
49+
| RHEL (< 10) | pcre-devel, openssl-devel, zlib-devel, systemd-devel, tar |
50+
| RHEL (>= 10) | pcre2-devel, openssl-devel, zlib-devel, systemd-devel, tar |
51+
| SUSE | pcre-devel, libopenssl-devel, zlib-devel, systemd-devel |
52+
53+
### Optional Build Dependencies
54+
55+
| Feature | Debian | RHEL |
56+
|-----------|---------------------|----------------|
57+
| Lua | liblua5.3-dev | lua-devel |
58+
| OpenSSL 3 | libssl-dev (>= 3.0) | openssl3-devel |
59+
60+
## Architecture Limitations
61+
62+
- All platforms provide amd64/x86_64 packages
63+
- arm64/aarch64 packages available on Debian 11+, Ubuntu 20.04+, RHEL 9+
64+
- Source compilation works on all architectures with appropriate cross-compiler
65+
66+
## Known Issues
67+
68+
- PCRE1 (`pcre-devel`) is deprecated on RHEL/CentOS/AlmaLinux/Rocky >= 10; the cookbook
69+
automatically selects PCRE2 (`pcre2-devel`) on those platforms
70+
- IUS repository support is limited to RHEL 6/7 (both EOL) and should be considered deprecated
71+
- OpenSSL source compilation has known issues (see [#503](https://github.com/sous-chefs/haproxy/issues/503))
72+
- The `haproxy-systemd-wrapper` binary is only used for HAProxy versions < 1.8

kitchen.dokken.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
---
12
driver:
23
name: dokken
34
privileged: true
4-
chef_version: <%= ENV['CHEF_VERSION'] || 'current' %>
5+
chef_version: 18.9.4
56

67
transport: { name: dokken }
78
provisioner: { name: dokken }
@@ -10,84 +11,84 @@ platforms:
1011
- name: almalinux-8
1112
driver:
1213
image: dokken/almalinux-8
13-
pid_one_command: /usr/lib/systemd/systemd
14+
pid_one_command: ["/usr/lib/systemd/systemd"]
1415

1516
- name: almalinux-9
1617
driver:
1718
image: dokken/almalinux-9
18-
pid_one_command: /usr/lib/systemd/systemd
19+
pid_one_command: ["/usr/lib/systemd/systemd"]
1920

2021
- name: almalinux-10
2122
driver:
2223
image: dokken/almalinux-10
23-
pid_one_command: /usr/lib/systemd/systemd
24+
pid_one_command: ["/usr/lib/systemd/systemd"]
2425

2526
- name: amazonlinux-2023
2627
driver:
2728
image: dokken/amazonlinux-2023
28-
pid_one_command: /usr/lib/systemd/systemd
29+
pid_one_command: ["/usr/lib/systemd/systemd"]
2930

3031
- name: centos-stream-9
3132
driver:
3233
image: dokken/centos-stream-9
33-
pid_one_command: /usr/lib/systemd/systemd
34+
pid_one_command: ["/usr/lib/systemd/systemd"]
3435

3536
- name: centos-stream-10
3637
driver:
3738
image: dokken/centos-stream-10
38-
pid_one_command: /usr/lib/systemd/systemd
39+
pid_one_command: ["/usr/lib/systemd/systemd"]
3940

4041
- name: debian-11
4142
driver:
4243
image: dokken/debian-11
43-
pid_one_command: /bin/systemd
44+
pid_one_command: ["/bin/systemd"]
4445

4546
- name: debian-12
4647
driver:
4748
image: dokken/debian-12
48-
pid_one_command: /bin/systemd
49+
pid_one_command: ["/bin/systemd"]
4950

5051
- name: fedora-latest
5152
driver:
5253
image: dokken/fedora-latest
53-
pid_one_command: /usr/lib/systemd/systemd
54+
pid_one_command: ["/usr/lib/systemd/systemd"]
5455

5556
- name: opensuse-leap-15
5657
driver:
5758
image: dokken/opensuse-leap-15
58-
pid_one_command: /usr/lib/systemd/systemd
59+
pid_one_command: ["/usr/lib/systemd/systemd"]
5960

6061
- name: oraclelinux-8
6162
driver:
6263
image: dokken/oraclelinux-8
63-
pid_one_command: /usr/lib/systemd/systemd
64+
pid_one_command: ["/usr/lib/systemd/systemd"]
6465

6566
- name: oraclelinux-9
6667
driver:
6768
image: dokken/oraclelinux-9
68-
pid_one_command: /usr/lib/systemd/systemd
69+
pid_one_command: ["/usr/lib/systemd/systemd"]
6970

7071
- name: rockylinux-8
7172
driver:
7273
image: dokken/rockylinux-8
73-
pid_one_command: /usr/lib/systemd/systemd
74+
pid_one_command: ["/usr/lib/systemd/systemd"]
7475

7576
- name: rockylinux-9
7677
driver:
7778
image: dokken/rockylinux-9
78-
pid_one_command: /usr/lib/systemd/systemd
79+
pid_one_command: ["/usr/lib/systemd/systemd"]
7980

8081
- name: ubuntu-20.04
8182
driver:
8283
image: dokken/ubuntu-20.04
83-
pid_one_command: /bin/systemd
84+
pid_one_command: ["/bin/systemd"]
8485

8586
- name: ubuntu-22.04
8687
driver:
8788
image: dokken/ubuntu-22.04
88-
pid_one_command: /bin/systemd
89+
pid_one_command: ["/bin/systemd"]
8990

9091
- name: ubuntu-24.04
9192
driver:
9293
image: dokken/ubuntu-24.04
93-
pid_one_command: /bin/systemd
94+
pid_one_command: ["/bin/systemd"]

0 commit comments

Comments
 (0)