Chef Best Practices — Profile, Cookbook, and Policy

Best practices for developing, testing, and releasing profiles, cookbooks, and policies

Larry | Peng Yang
Software Configuration Manuals

--

Photo by isword on Unsplash

Highlights

  1. Write InSpec Profiles once and use them everywhere
  2. Test-Driven Development using InSpec Profiles
  3. Test locally and build/release using CI/CD pipelines
  4. Use chef_cookbook_generator to generate the cookbooks and policies
  5. Use data bags even with kitchen test
  6. Use Azure DevOps as repositories and CI/CD pipelines
  7. Use kitchen-azurerm as the test driver
  8. Use Artifactory to store cookbooks and binaries
  9. 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…

--

--