Tag Chef

How to run tests from the ChefDK in Docker

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

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

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'

The unfortunate decision to cancel my Packt training courses.

Test-Driven Chef Cookbook Development Using ChefSpec (and a sprinkling of InSpec)

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.

Using `chef-shell` to interactively debug attributes and recipes

How to use chef-shell to see attribute config and recipes, with and without a Chef Server.

OggCamp 2018

A look at my time at OggCamp 2018, the talks I presented and attended.

Some exciting job and knowledge-sharing news

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

Notes from the AWS Dev Day Roadshow in London, where we got to play around with Chef, Chef Automate and InSpec using AWS OpsWorks.

Beware: `delete`ing a `file` in Chef doesn't actually `delete` it

Why you should explicitly add backup false when deleteing a file through Chef, to avoid leaving potentially sensitive files still on the box.

Morsels of Goodness: What's Cooking in Chef 14?

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

An example of how to create a helper gem for common Rake task, using the real-world example of Chef cookbooks.

Running `docker login` as another user in Chef

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

Disabling the Missing space after # and Do not use block comments errors for your knife-cookbook-doc formatted comments.

Chef 13 Upgrade: Deprecation of Namespace Collisions in Custom Resources

Preparing for breaking changes in Chef 14 by renaming property_name to new_resource.property_name in Custom Resources.

Chef 13 Upgrade: `knife-cookbook-doc` gem upgrade

Fixing odd Logger entries in autogenerated knife-cookbook-doc README.mds for Chef 13

Testing Chef's `ruby_block`s with ChefSpec

Testing implementation of a ruby_block in ChefSpec, to ensure that the code executes as expected

Chef 13 Upgrade: Lessons Learnt and Documented for Posterity

Notes on the main problems encountered when upgrading from Chef 12 to Chef 13, both with ChefSpec and Rubocop.

Chef 13 Upgrade: Rubocop Changes for Testing `render_file` with ChefSpec and a `with_content` Block

How to resolve the Parenthesize the param render_file Rubocop error when upgrading your cookbook to Chef 13.

Chef 13 Upgrade: Rubocop Changes for Word Array Literals (`%w`)

A one-liner shell command to fix Rubocop errors %w-literals should be delimited by [ and ].

Chef 13 Upgrade: Rubocop Changes for `lazy` Parameters

How to resolve the Parenthesize the param lazy Rubocop error when upgrading your cookbook to Chef 13.

Chef 13 Upgrade: Testing `ruby_block`s with ChefSpec

Replace your block.old_run_action with block.block.call to trigger ruby_blocks within ChefSpec 7 and Chef 13.

`SSLError` When Running Berkshelf Behind a Proxy

Getting around the pesky OpenSSL::SSL::SSLError SSLv2/v3 read server hello A error when running Berkshelf behind a proxy

Running `service` resources in Kitchen-Docker

How to get up and running with service resources when running Test Kitchen with the Docker driver, in this example for use with GitLab CI.

Trusting Self-Signed Certificates from the Chef Development Kit

How to get the ChefDK (and associated tools) to trust internal / self-signed certificates, in an easy oneliner.

Getting around `Permission Denied` when running ChefSpec

How to handle getting an EACCES when trying to run ChefSpec on a recipe.

Testing `include_recipe`s with Chef and ChefSpec

How to best test include_recipes within your Chef recipes, as well as how to ensure that you aren't running any dependent recipes in your tests.

Building Chef Cookbooks with GitLab (Part 1)

An introduction to how to build a cookbook using GitLab's Continuous Integration platform in conjunction with kitchen-docker.