Chef Best Practices — Profile, Cookbook, and Policy
Best practices for developing, testing, and releasing profiles, cookbooks, and policies
Published in
11 min readDec 24, 2020
Highlights
- Write InSpec Profiles once and use them everywhere
- Test-Driven Development using InSpec Profiles
- Test locally and build/release using CI/CD pipelines
- Use chef_cookbook_generator to generate the cookbooks and policies
- Use data bags even with kitchen test
- Use Azure DevOps as repositories and CI/CD pipelines
- Use kitchen-azurerm as the test driver
- Use Artifactory to store cookbooks and binaries
- Use Audit cookbook in Policies
Overview
Unlike other types of development, developing, testing, and releasing Chef stuff can be difficult and challenging. I am gonna walk you through how I minimize the work and maximize the efficiency of the development and deployment. Hope you will gain some inspiration from this article.
InSpec Profile
Profiles are the core of the Chef InSpec testing experience. Use Chef InSpec profiles to manage everything you need to run a…