Skip to content

feat: modernize chrony cookbook and refactor master to server#74

Merged
damacus merged 8 commits intomainfrom
modernize-chrony
Mar 25, 2026
Merged

feat: modernize chrony cookbook and refactor master to server#74
damacus merged 8 commits intomainfrom
modernize-chrony

Conversation

@damacus
Copy link
Copy Markdown
Member

@damacus damacus commented Mar 24, 2026

This PR modernizes the chrony cookbook by refactoring it to a resource-based API, updating platform support to modern stable releases, and renaming 'master' terminology to 'server'. It also consolidates templates and updates the test suite.

- Refactor to resource-based API with 'chrony_config' custom resource.
- Remove EOL platforms (CentOS 7/8, Debian 9/10) and add modern ones (Ubuntu 22.04, Debian 12, Rocky 9).
- Rename 'master' terminology to 'server' throughout recipes, tests, and documentation.
- Consolidate templates into a single 'chrony.conf.erb'.
- Update InSpec and ChefSpec tests for new resource and platforms.
@damacus damacus requested a review from a team as a code owner March 24, 2026 12:23
damacus added 7 commits March 24, 2026 12:43
- Fix ChefSpec tests by adding 'step_into' for the 'chrony_config' resource.
- Set 'allow' attribute in server spec to ensure proper template rendering.
- Import '.markdownlint-cli2.yaml' and '.mdlrc' from confluence cookbook.
- Update kitchen.yml and kitchen.dokken.yml to only test non-EOL platforms.
- Update metadata.rb to reflect modern supported OS versions (Ubuntu 22.04+, Debian 12, RHEL 9+).
- Update .github/workflows/ci.yml to match modern platform list.
- Add frozen_string_literal and provides to chrony_config resource.
- Add resource documentation.
- Add LIMITATIONS.md with vendor support details.
- Ensure all kitchen and CI files are in sync.
- Remove Debian 11, Ubuntu 20.04, and RHEL/Alma/Rocky 8 from all configurations.
- Update LIMITATIONS.md, metadata.rb, kitchen files, and .github/workflows/ci.yml.
- Update ChefSpec tests to focus on AlmaLinux 9.
Remove recipes/ and attributes/ directories — users should call the
chrony_config resource directly instead of chrony::client or
chrony::server recipes.

- Fix duplicate driftfile declaration in template
- Scope helpers module to action_class only (remove global mixin)
- Inline default_driftfile logic into lazy property default
- Rewrite ChefSpec tests to test chrony_config resource directly
- Split integration tests into per-suite InSpec profiles (default/server)
- Restructure test cookbook to exercise resource without recipes
- Align kitchen.yml, kitchen.dokken.yml, and CI matrix (9 platforms × 2 suites)
- Update LIMITATIONS.md and README.md for resource-only usage

BREAKING CHANGE: chrony::client, chrony::server, and chrony::default
recipes have been removed. Use the chrony_config resource directly in
wrapper cookbooks. The Chef search feature for auto-discovering server
nodes is no longer provided — implement in your own wrapper cookbook
if needed.
@github-actions
Copy link
Copy Markdown

Slowest examples

Top 10 slowest examples (0.13 seconds, 98.17% of total time)
Example Description Time in seconds
spec/shared_examples.rb:4 chrony_config :create action on AlmaLinux 9 (RHEL family) installs the chrony package 0.04438
spec/shared_examples.rb:4 chrony_config :create action on Ubuntu 24.04 (Debian family) installs the chrony package 0.02628
spec/unit/resources/config_spec.rb:69 chrony_config :create action with server configuration (allow directives) renders allow directives 0.02417
spec/unit/resources/config_spec.rb:84 chrony_config :delete action stops the chrony service 0.01697
spec/unit/resources/config_spec.rb:21 chrony_config :create action on AlmaLinux 9 (RHEL family) renders the config with default servers 0.00917
spec/unit/resources/config_spec.rb:55 chrony_config :create action on Ubuntu 24.04 (Debian family) uses Debian driftfile path 0.00643
spec/unit/resources/config_spec.rb:26 chrony_config :create action on AlmaLinux 9 (RHEL family) uses RHEL driftfile path 0.00108
spec/unit/resources/config_spec.rb:36 chrony_config :create action on AlmaLinux 9 (RHEL family) includes extra_config lines 0.00107
spec/unit/resources/config_spec.rb:31 chrony_config :create action on AlmaLinux 9 (RHEL family) does not include allow directives for client config 0.00099
spec/shared_examples.rb:12 chrony_config :create action on AlmaLinux 9 (RHEL family) enables the chrony service 0.00038

@damacus damacus merged commit 283883f into main Mar 25, 2026
27 checks passed
@damacus damacus deleted the modernize-chrony branch March 25, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant