Chef cookbook for managing software installation and configuration. Part of the Sous Chefs cookbook ecosystem.
Key Facts: Ruby-based, Chef >= 16 required, supports various OS platforms (check metadata.rb, kitchen.yml and .github/workflows/ci.yml for which platforms to specifically test)
Critical Paths:
recipes/- Chef recipes for cookbook functionality (if this is a recipe-driven cookbook)resources/- Custom Chef resources with properties and actions (if this is a resource-driven cookbook)spec/- ChefSpec unit teststest/integration/- InSpec integration tests (tests all platforms supported)test/cookbooks/ortest/fixtures/- Example cookbooks used during testing that show good examples of custom resource usageattributes/- Configuration for recipe driven cookbooks (not applicable to resource cookbooks)libraries/- Library helpers to assist with the cookbook. May contain multiple files depending on complexity of the cookbook.templates/- ERB templates that may be used in the cookbookfiles/- files that may be used in the cookbookmetadata.rb,Berksfile- Cookbook metadata and dependencies
MANDATORY: Install Chef Workstation first - provides chef, berks, cookstyle, kitchen tools.
berks install # Install dependencies (always first)
cookstyle # Ruby/Chef linting
yamllint . # YAML linting
markdownlint-cli2 '**/*.md' # Markdown linting
chef exec rspec # Unit tests (ChefSpec)
# Integration tests will be done via the ci.yml action. Do not run these. Only check the action logs for issues after CI is done running.- Kitchen Matrix: Multiple OS platforms × software versions (check kitchen.yml for specific combinations)
- Docker Required: Integration tests use Dokken driver
- CI Environment: Set
CHEF_LICENSE=accept-no-persist - Full CI Runtime: 30+ minutes for complete matrix
- Always run
berks installfirst - most failures are dependency-related - Docker must be running for kitchen tests
- Chef Workstation required - no workarounds, no alternatives
- Test data bags needed (optional for some cookbooks) in
test/integration/data_bags/for convergence
- Edit recipes/resources/attributes/templates/libraries
- Update corresponding ChefSpec tests in
spec/ - Also update any InSpec tests under test/integration
- Ensure cookstyle and rspec passes at least. You may run
cookstyle -ato automatically fix issues if needed. - Also always update all documentation found in README.md and any files under documentation/*
- Always update CHANGELOG.md (required by Dangerfile) - Make sure this conforms with the Sous Chefs changelog standards.
- PR description >10 chars (Danger enforced)
- CHANGELOG.md entry for all code changes
- Version labels (major/minor/patch) required
- All linters must pass (cookstyle, yamllint, markdownlint)
- Test updates needed for code changes >5 lines and parameter changes that affect the code logic
- Custom resources in
resources/with properties and actions - Include comprehensive ChefSpec tests for all actions
- Follow Chef resource DSL patterns
- Use
include_recipefor modularity - Handle platforms with
platform_family?conditionals - Use encrypted data bags for secrets (passwords, SSL certs)
- Leverage attributes for configuration with defaults
- ChefSpec (Unit): Mock dependencies, test recipe logic in
spec/ - InSpec (Integration): Verify actual system state in
test/integration/inspec/- InSpec files should contain proper inspec.yml and controls directories so that it could be used by other suites more easily. - One test file per recipe, use standard Chef testing patterns
These instructions are validated for Sous Chefs cookbooks. Do not search for build instructions unless information here fails.
Error Resolution Checklist:
- Verify Chef Workstation installation
- Confirm
berks installcompleted successfully - Ensure Docker is running for integration tests
- Check for missing test data dependencies
The CI system uses these exact commands - following them matches CI behavior precisely.