Showing posts with label chef. Show all posts
Showing posts with label chef. Show all posts

Saturday, December 16, 2023

How To Customize Chef Recipes To Compatible With Multiple Chef Client Versions

Metadata.rb is used in Chef to define several important metadata values within the Chef cookbook. Chef infra client version is one of them. The Chef version setting can be used to define the range of chef client versions supported by the cookbook.

For example, the following specifies a match for any chef client version in the16.x series. The configurations defined in Chef recipes will be applied only to servers (nodes) running chef client version 16.x

                chef_version '~> 16.0'

However, even after setting the 'chef_version' for cookbook as shown in the above example, you can still customize your recipes to work with other chef client versions.

This blog explains one possible mechanism for customizing a Chef recipe to run with different versions of Chef clients. 

Pre-requisites: chef workstation, chef cookbook

Let's get started.

Wednesday, September 14, 2022

Resolve "maximum shards open; [type=validation_exception]" in Chef Automate Dashboard

This blog explains how to fix Chef dashboard compliance failure due to exceeding shards limit, which may give you an error similar to below.

Issue: Chef automate compliance node connection failing with following error message.

invalid output Report processing error: rpc error: code = Internal desc = InsertInspecReport: elastic: Error 400 (Bad Request): Validation Failed: 1: this action would add [10] total shards, but this cluster currently has [998]/[1000] maximum shards open; [type=validation_exception]

Monday, August 22, 2022

Resolve Chef Kitchen Verify Error "Cannot converge without accepting the Chef Infra Client License"

You might have experienced, Azure pipeline failing from kitchen verify step due to Chef Infra client License not accepted error while  creating a Chef test kitchen in Azure. Let's look at how to fix this issue in this post.

Wednesday, August 17, 2022

Creating Chef Test Kitchen in Azure Using Azure Pipelines

When you are working with Chef, you can use chef’s integrated testing framework to test recipes to ensures recipes run as expected before applying recipes to production. This blog explains how to configure, chef test kitchen in an Azure VM using Azure DevOps pipeline.

Thursday, August 11, 2022

Resolve "Kitchen.yml does not exist" Issue in Azure Pipelines with Execute Chef Component Task

You might encounter "kitchen.yml does not exist" issue with execute chef component task in Azure pipelines. Reason for this failure is, Azure DevOps pipeline task is looking for the kitchen.yml file in the Build.SourcesDirectory by default. Further, there is no parameter to pass the kitchen.yml file location with kitchen create command.