Finally got around to writing up the work that I did at Capital One on our #Chef pipelines which I was very proud of.
It's a bit of a long read, but details some pretty impactful changes made over several months of solo work - between games of Apex Legends - and hopefully is transferrable to other folks.
TL;DR is listen to what your users want, instead of telling them to use a thing they don't particularly like but have no choice in
What I learned rebuilding our CI/CD pipelines for Chef Cookbooks (22 mins read).
How a focus on developer experience and user needs helped us rebuild (Capital One's) CI/CD pipelines for Chef cookbooks the right way.
Updating the CA Certificate bundle in Chef Installations (3 mins read).
How to update/add new certificates to the Certificate Authority Certificate Bundle in a Chef Development Kit / Workstation installation.
Debugging Chef Variables With Logs (3 mins read).
How you can use different means of logging to make operations with Chef cookbook a little easier.
Converting a Kitchen YAML to Chef Attributes (2 mins read).
How to convert attributes being set for your Chef Test Kitchen integration tests to an
Programatically Comparing Versions Using Chef's Versioning Schemes (1 mins read).
How to use Chef's versioning classes to determine whether a version constraint is matched.
Uploading Community Cookbooks from Supermarket to Chef Server (1 mins read).
How to upload a given community cookbook from Chef Supermarket to Chef Server, using Berkshelf.
Constructing an Ordered Dependency Graph for Chef Cookbooks, using Berkshelf (3 mins read).
How to create a dependency graph for a given cookbook's dependencies to understand the order to install them in.
Hey #ChefFriends how do you generally manage syncing a cookbook between Supermarket and #Chef Server? Wondered if there's anything currently out there to pull the cookbook and it's dependencies, in the right order to Server?
Using Dynamically Generated Non-AWS Owned SSH Keys with Test Kitchen on EC2 (3 mins read).
How to set up kitchen-ec2 to use an SSH key that isn't available in AWS by amending the
user-data of the created EC2 instance.
Waiting for SSH service on Test Kitchen with the Docker driver (1 mins read).
How to resolve
Waiting for SSH service when running kitchen-docker.
Better Chef Reporting for Automated Pipelines (1 mins read).
How to get better machine-parseable reports for your Chef Pipelines.
Managing Your Chef Gem Dependencies More Easily in your
Gemfile (2 mins read).
How to source your Chef Gem dependencies from your Chef cookbook's
metadata.rb instead of duplicating them between files.
Programatically Determining the Version of a Chef Cookbook (1 mins read).
How to determine a Chef cookbook's version programatically, using Ruby.
How to Use Cookstyle to Autocorrect Style Issues (1 mins read).
How to use the
cookstyle tool with Chef cookbooks to autocorrect style issues.
Well it's taken me a few years, but I've finally worked out how to manage Gems in #Chef without horrible
chef exec bundle exec ... commands https://www.jvt.me/posts/2021/02/22/chefdk-gemfile/
Installing Gems From Your
Gemfile When Developing Chef Cookbooks using the ChefDK / Chef Workstation (2 mins read).
How to install Ruby Gems in local development using your
Gotcha: AWS SDK Proxy Setup with Test Kitchen (2 mins read).
How to avoid odd proxy issues when using the AWS SDK, when using Test Kitchen.
Using Chef to Delete Files that aren't in a List (2 mins read).
How to delete files in a directory that don't match a list.
ChefSpec Gotcha: Using
render_file When Deleting Files (2 mins read).
How to use
render_file with ChefSpec when you're deleting the file.
Chef Attributes and
default.rb - it's in the name (3 mins read).
Why you should only be setting defaults in your Chef attributes, and moving heavy lifting elsewhere.
Setting up a custom RubyGems Repository for Chef in Test Kitchen (1 mins read).
How to use a private RubyGems repository for your Chef gem dependencies in Test Kitchen.
How Many Gadgets Does the Kitchen Need?! The Many Tools for Chef Dependency Management (5 mins read).
Looking at the different dependency management solutions of Chef, and how, where and why you would use each one.
Performing a No-Op with
chef-client using JSON (2 mins read).
How to perform a
chef-client run without executing anything.
How to run tests from the ChefDK in Docker (6 mins read).
How to get up and running with the ChefDK to perform common tests, such as unit tests and linting.
Using Fake Cookbooks for Writing ChefSpec Tests for your Custom Chef Resources (3 mins read).
A directory structure I've found quite useful for writing ChefSpec tests for custom resources, by creating a fake cookbook within the cookbook you're testing.
Chef 14 Upgrade: Change in
ValidationFailed error messages when setting
required properties (2 mins read).
The updated error message returned by a Chef
ValidationFailed error, when you're specifying which properties are
required on a custom resource.
Revert 'Some knowledge-sharing news' (5 mins read).
The unfortunate decision to cancel my Packt training courses.
Test-Driven Chef Cookbook Development Using ChefSpec (and a sprinkling of InSpec) (39 mins read).
Using the example of deploying and running a Java JAR file as a way to show the lifecycle of a fully test-driven Chef cookbook.
chef-shell to interactively debug attributes and recipes (5 mins read).
How to use
chef-shell to see attribute config and recipes, with and without a Chef Server.
OggCamp 2018 (21 mins read).
A look at my time at OggCamp 2018, the talks I presented and attended.
Some exciting job and knowledge-sharing news (4 mins read).
Moving into Quality Engineering, publishing Chef training courses, conference speaking about Chef at OggCamp and the complex mess that is this very static website at DevOpsDays London.
Notes from the AWS + Chef Dev Day Roadshow in London (13 mins read).
Notes from the AWS Dev Day Roadshow in London, where we got to play around with Chef, Chef Automate and InSpec using AWS OpsWorks.
file in Chef doesn't actually
delete it (3 mins read).
Why you should explicitly add
backup false when
file through Chef, to avoid leaving potentially sensitive files still on the box.
Morsels of Goodness: What's Cooking in Chef 14? (5 mins read).
A look at the new features coming in the new Chef 14 release, as well as what to watch out for when upgrading.
Bundling Common Rake Tasks into a Gem (8 mins read).
An example of how to create a helper gem for common Rake task, using the real-world example of Chef cookbooks.
docker login as another user in Chef (2 mins read).
Hitting the error
permission denied while trying to connect to the Docker daemon socket when trying to run
docker login as a non-root user in Chef.
Chef 13 Upgrade:
knife-cookbook-doc Rubocop Updates (1 mins read).
Missing space after # and
Do not use block comments errors for your
knife-cookbook-doc formatted comments.