Skip to content
Merged
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
21 changes: 9 additions & 12 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
---
name: 'Validate PR'
name: conventional-commits

"on":
pull_request_target:
types: [opened, edited, reopened]
pull_request:
types:
- opened
- reopened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
conventional-commits:
uses: sous-chefs/.github/.github/workflows/conventional-commits.yml@5.0.3
24 changes: 24 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: 'Copilot Setup Steps'

"on":
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
copilot-setup-steps:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install Chef
uses: actionshub/chef-install@main
- name: Install cookbooks
run: berks install
39 changes: 11 additions & 28 deletions .github/workflows/prevent-file-change.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,16 @@
---
name: Prevent file change
name: prevent-file-change

"on":
pull_request_target:
branches: [main]
pull_request:
types:
- opened
- reopened
- edited
- synchronize

jobs:
prevent-metadata-change:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Prevent metadata.rb file change
uses: xalvarez/prevent-file-change-action@v2
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
pattern: metadata.rb
trustedAuthors: &maintainers bmhughes,damacus,kitchen-porter,MarkGibbons,ramereth,Stromweld,xorima

prevent-workflow-change:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Prevent workflow file change
uses: xalvarez/prevent-file-change-action@v2
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
pattern: .github/workflows
trustedAuthors: *maintainers
closePR: true
allowNewFiles: false
prevent-file-change:
uses: sous-chefs/.github/.github/workflows/prevent-file-change.yml@5.0.3
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
76 changes: 9 additions & 67 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
name: release-please
name: release

"on":
push:
branches: [main]
branches:
- main

permissions:
contents: write
Expand All @@ -14,68 +15,9 @@ permissions:
id-token: write

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
upload_url: ${{ steps.release.outputs.upload_url }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.PORTER_GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v5
if: ${{ steps.release.outputs.release_created }}

- name: Upload cookbook as artifact
if: ${{ steps.release.outputs.release_created }}
id: upload
uses: actions/upload-artifact@v4
with:
name: haproxy-cookbook-${{ steps.release.outputs.tag_name }}
path: |
.
!.git/
!.github/
!.kitchen/
!.vscode/
!documentation/
!.gitignore
!test/
!spec/
retention-days: 90
compression-level: 6

- name: Generate artifact attestation
if: ${{ steps.release.outputs.release_created }}
uses: actions/attest-build-provenance@v3
with:
subject-name: haproxy-cookbook-${{ steps.release.outputs.tag_name }}
subject-digest: sha256:${{ steps.upload.outputs.artifact-digest }}

publish-to-supermarket:
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
container:
image: chef/chefworkstation:latest
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Configure Chef credentials
run: |
mkdir -p ~/.chef
echo "${{ secrets.CHEF_SUPERMARKET_KEY }}" > ~/.chef/supermarket.pem
chmod 600 ~/.chef/supermarket.pem

- name: Publish to Chef Supermarket
run: |
knife supermarket share haproxy \
--supermarket-site https://supermarket.chef.io \
--key ~/.chef/supermarket.pem \
--user ${{ secrets.CHEF_SUPERMARKET_USER }} \
--cookbook-path ../
release:
uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@5.0.3
secrets:
token: ${{ secrets.PORTER_GITHUB_TOKEN }}
supermarket_user: ${{ secrets.CHEF_SUPERMARKET_USER }}
supermarket_key: ${{ secrets.CHEF_SUPERMARKET_KEY }}
3 changes: 2 additions & 1 deletion .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ config:
line-length: false # MD013
no-duplicate-heading: false # MD024
reference-links-images: false # MD052
no-multiple-blanks: false # MD012 Ignore due to release-please
no-multiple-blanks:
maximum: 2
ignores:
- .github/copilot-instructions.md
52 changes: 6 additions & 46 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,58 @@ This file is used to list changes made in each version of the haproxy cookbook.

## [12.4.11](https://github.com/sous-chefs/haproxy/compare/v12.4.10...v12.4.11) (2025-09-15)


### Bug Fixes

* **ci:** Fix share command ([#556](https://github.com/sous-chefs/haproxy/issues/556)) ([f63a220](https://github.com/sous-chefs/haproxy/commit/f63a220b586cd8d6c54f9401f4b42769d2a0239c))
**ci:** Fix share command ([#556](https://github.com/sous-chefs/haproxy/issues/556)) ([f63a220](https://github.com/sous-chefs/haproxy/commit/f63a220b586cd8d6c54f9401f4b42769d2a0239c))

## [12.4.10](https://github.com/sous-chefs/haproxy/compare/v12.4.9...v12.4.10) (2025-09-15)


### Bug Fixes

* **tests:** Add unit test coverage for haproxy_listen option parameter (already implemented) ([#550](https://github.com/sous-chefs/haproxy/issues/550)) ([2be5b18](https://github.com/sous-chefs/haproxy/commit/2be5b18e52fc64949b5ea3824dfd79528b44af70))
**tests:** Add unit test coverage for haproxy_listen option parameter (already implemented) ([#550](https://github.com/sous-chefs/haproxy/issues/550)) ([2be5b18](https://github.com/sous-chefs/haproxy/commit/2be5b18e52fc64949b5ea3824dfd79528b44af70))

## [12.4.9](https://github.com/sous-chefs/haproxy/compare/v12.4.8...v12.4.9) (2025-09-12)


### Bug Fixes

* output reference in workflow ([#552](https://github.com/sous-chefs/haproxy/issues/552)) ([3711253](https://github.com/sous-chefs/haproxy/commit/3711253ace28ae7b979aeb9cebbab3d5e2aa5e96))

## [12.4.8](https://github.com/sous-chefs/haproxy/compare/v12.4.7...v12.4.8) (2025-09-11)


### Bug Fixes

* Missing slash in release.yml ([#548](https://github.com/sous-chefs/haproxy/issues/548)) ([b212876](https://github.com/sous-chefs/haproxy/commit/b212876afe9d633ac826895daba950f029246c16))

## [12.4.7](https://github.com/sous-chefs/haproxy/compare/v12.4.6...v12.4.7) (2025-09-11)


### Bug Fixes

* fix pathing ([bb5a070](https://github.com/sous-chefs/haproxy/commit/bb5a0707fa9892829c15e3a596de1332d6ff6b1a))

## [12.4.6](https://github.com/sous-chefs/haproxy/compare/v12.4.5...v12.4.6) (2025-09-11)


### Bug Fixes

* **ci:** Fix supermarket share command typo ([cea808c](https://github.com/sous-chefs/haproxy/commit/cea808c6216d54745fe852aaa49e6b8efe0e6a12))
**ci:** Fix supermarket share command typo ([cea808c](https://github.com/sous-chefs/haproxy/commit/cea808c6216d54745fe852aaa49e6b8efe0e6a12))

## [12.4.5](https://github.com/sous-chefs/haproxy/compare/v12.4.4...v12.4.5) (2025-09-11)


### Bug Fixes

* **ci:** More CI fixes ([#544](https://github.com/sous-chefs/haproxy/issues/544)) ([88a9ca0](https://github.com/sous-chefs/haproxy/commit/88a9ca00a24318ecbd2426fc3cc4e0ac0268762f))
**ci:** More CI fixes ([#544](https://github.com/sous-chefs/haproxy/issues/544)) ([88a9ca0](https://github.com/sous-chefs/haproxy/commit/88a9ca00a24318ecbd2426fc3cc4e0ac0268762f))

## [12.4.4](https://github.com/sous-chefs/haproxy/compare/v12.4.3...v12.4.4) (2025-09-11)


### Bug Fixes

* **ci:** Fix attestation ([#541](https://github.com/sous-chefs/haproxy/issues/541)) ([5c92cbd](https://github.com/sous-chefs/haproxy/commit/5c92cbdfd984f300957dc4aa0014408505ef1915))
**ci:** Fix attestation ([#541](https://github.com/sous-chefs/haproxy/issues/541)) ([5c92cbd](https://github.com/sous-chefs/haproxy/commit/5c92cbdfd984f300957dc4aa0014408505ef1915))

## [12.4.3](https://github.com/sous-chefs/haproxy/compare/v12.4.2...v12.4.3) (2025-09-11)


### Bug Fixes

* .release-please-manifest.json ([#523](https://github.com/sous-chefs/haproxy/issues/523)) ([bf9797d](https://github.com/sous-chefs/haproxy/commit/bf9797db291e794c150a9e713064c4e8f3062f03))
* **ai:** Add GitHub Copilot instructions ([#536](https://github.com/sous-chefs/haproxy/issues/536)) ([4836686](https://github.com/sous-chefs/haproxy/commit/4836686016b10f1be5423661d65191977b6d77ed))
**ai:** Add GitHub Copilot instructions ([#536](https://github.com/sous-chefs/haproxy/issues/536)) ([4836686](https://github.com/sous-chefs/haproxy/commit/4836686016b10f1be5423661d65191977b6d77ed))
* Fix tested platforms & Add publishing support ([#519](https://github.com/sous-chefs/haproxy/issues/519)) ([ff3daaa](https://github.com/sous-chefs/haproxy/commit/ff3daaa37d08f7757fe28d78dcd76c44edeeb083))
* release please manifest ([#524](https://github.com/sous-chefs/haproxy/issues/524)) ([e4421fd](https://github.com/sous-chefs/haproxy/commit/e4421fd31d1c27ed1134017847c5991839edb2db))
* Remove EOL HAProxy 2.9 & update workflows ([#531](https://github.com/sous-chefs/haproxy/issues/531)) ([5ffa69f](https://github.com/sous-chefs/haproxy/commit/5ffa69fca2b418bb9cdd6c3482d9f76d78b22f99))
Expand All @@ -73,7 +64,6 @@ This file is used to list changes made in each version of the haproxy cookbook.

## [12.4.2](https://github.com/sous-chefs/haproxy/compare/12.4.1...v12.4.2) (2025-09-10)


### Bug Fixes

* .release-please-manifest.json ([#523](https://github.com/sous-chefs/haproxy/issues/523)) ([bf9797d](https://github.com/sous-chefs/haproxy/commit/bf9797db291e794c150a9e713064c4e8f3062f03))
Expand All @@ -83,8 +73,6 @@ This file is used to list changes made in each version of the haproxy cookbook.
* Revert to simple release-please config to prevent Node.js auto-detection ([e1f3324](https://github.com/sous-chefs/haproxy/commit/e1f3324ca4534d84377d10492e9466e8c065d477))
* With conventional commits we do not require labels ([#527](https://github.com/sous-chefs/haproxy/issues/527)) ([a02cf07](https://github.com/sous-chefs/haproxy/commit/a02cf07dff74e6499bed044e11abe6589b017c8a))

## 12.4.1 - *2025-09-04*

## 12.4.0 - *2024-12-09*

* Add `option` property to `haproxy_listen`
Expand All @@ -94,20 +82,10 @@ This file is used to list changes made in each version of the haproxy cookbook.

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

## 12.3.6 - *2024-11-05*

## 12.3.5 - *2024-07-15*

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

## 12.3.4 - *2024-05-03*

## 12.3.3 - *2024-05-03*

## 12.3.2 - *2024-02-01*

## 12.3.1 - *2024-02-01*

## 12.3.0 - *2024-01-31*

* Update default HAProxy source install verision to 2.8.5
Expand All @@ -123,28 +101,10 @@ Standardise files with files in sous-chefs/repo-management
* Fix source lua tests on CentOS & Fedora
* Remove OpenSSL tests, as this is out of scope of the core cookbook currently

## 12.2.24 - *2024-01-31*

## 12.2.23 - *2023-10-26*

## 12.2.22 - *2023-09-28*

## 12.2.21 - *2023-09-04*

## 12.2.20 - *2023-08-30*

## 12.2.19 - *2023-05-17*

## 12.2.18 - *2023-04-17*

## 12.2.17 - *2023-04-07*

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

## 12.2.16 - *2023-04-01*

## 12.2.15 - *2023-04-01*

## 12.2.14 - *2023-04-01*

Standardise files with files in sous-chefs/repo-management
Expand Down
2 changes: 1 addition & 1 deletion resources/frontend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
description: 'Set the running mode or protocol of the instance'

property :maxconn, [Integer, String],
coerce: proc { |p| p.to_s },
coerce: proc(&:to_s),
description: 'Sets the maximum per-process number of concurrent connections'

property :default_backend, String,
Expand Down
4 changes: 2 additions & 2 deletions resources/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ def do_service_action(resource_action)
declare_resource(:service, new_resource.service_name).delayed_action(resource_action)
rescue Mixlib::ShellOut::ShellCommandFailed
if new_resource.config_test_fail_action.eql?(:log)
Chef::Log.error("Configuration test failed, #{new_resource.service_name} #{resource_action} action aborted!\n\n"\
Chef::Log.error("Configuration test failed, #{new_resource.service_name} #{resource_action} action aborted!\n\n" \
"Error\n-----\n#{cmd.stderr}")
else
raise "Configuration test failed, #{new_resource.service_name} #{resource_action} action aborted!\n\n"\
raise "Configuration test failed, #{new_resource.service_name} #{resource_action} action aborted!\n\n" \
"Error\n-----\nAction: #{resource_action}\n#{cmd.stderr}"
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/cookbooks/test/recipes/source_lua.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# extract lua
execute 'lua extract' do
command 'tar xf lua-5.3.1.tar.gz'
cwd "#{Chef::Config[:file_cache_path]}"
cwd Chef::Config[:file_cache_path].to_s
not_if { ::File.exist?('/opt/lua-5.3.1/bin/lua') }
end

Expand Down
24 changes: 12 additions & 12 deletions test/integration/config_3/controls/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@
'',
'',
'listen admin',
' mode http',
' bind 0.0.0.0:1337',
' stats uri /',
' stats realm Haproxy-Statistics',
' stats auth user:pwd',
' http-request add-header X-Forwarded-Proto https if { ssl_fc }',
' http-request add-header X-Proto http',
' http-response set-header Expires %\[date\(3600\),http_date\]',
' default_backend servers',
' option dontlog-normal',
' bind-process odd',
' hash-type consistent',
' mode http',
' bind 0.0.0.0:1337',
' stats uri /',
' stats realm Haproxy-Statistics',
' stats auth user:pwd',
' http-request add-header X-Forwarded-Proto https if { ssl_fc }',
' http-request add-header X-Proto http',
' http-response set-header Expires %\[date\(3600\),http_date\]',
' default_backend servers',
' option dontlog-normal',
' bind-process odd',
' hash-type consistent',
]

describe file('/etc/haproxy/haproxy.cfg') do
Expand Down