FATAL: Chef::Exceptions::Reboot: Rebooting server at a recipe’s request.

When your Chef recipe requests a reboot using the “reboot” Chef resource, the output window shows an error message: Chef Client finished, …/… resources updated in … seconds […] WARN: Rebooting server at a recipe’s request. Details: {:delay_mins=>1, :reason=>”…”, :timestamp=>…, :requested_by=>”…”} Running handlers: […] ERROR: Running exception handlers Running handlers complete […] ERROR: Exception handlers complete Chef …

Unable to satisfy constraints on package

When you make a change to the version restrictions in the metadata.rb file and execute berks install in your Chef cookbook directory, you may get the error message: Unable to satisfy constraints on package … due to solution constraint (…). Solution constraints that may result in a constraint on …: [(…)], [(…) -> (…)] Demand that …

could not find filename for attribute .DS_Store in cookbook

The Macintosh workstation saves application states in .DS_Store files. When you edit your Chef cookbooks the MacOS leaves these files in many folders. When the Chef cookbook is executed, the Chef Client reads all files in the attributes folder and tries to extract values from them. If the .DS_Store file is uploaded with the rest of …

Skip steps in an InSpec integration test based on Chef attribute values

To speed up the test of some complex recipes, I use an attribute to skip certain long-running installations when I only need to test the rest of the recipe. We will pass Chef Attribute values into an InSpec test using environment variables. Declare an attribute in the atrributes.rb file with a safe default value, to allow the …

Chef NoMethodError, undefined method

When you try to bootstrap a node to a Chef server, you may get the error message Compiling Cookbooks… ============================================================== Recipe Compile Error in c:/chef/cache/cookbooks/…/attributes/default.rb ============================================================== NoMethodError ————- undefined method `…=’ for #<Chef::Node::VividMash:0x0000000004ca3268> … Relevant File Content: >> default. … In my case, the cookbook compiler could not interpret the dot notation in the recipes. …

Switching to a new Chef server

The administrator of the Chef organization Download the validation key Do this only once for the organization. This step resets the validation key, so the existing server images will not be able to connect to the Chef organization. On the Administration tab on the left select Organizations > Reset validation Key Click the Reset Key …

Waiting for SSH service on …:22, retrying in 3 seconds

When you try to launch a new EC2 instance in AWS using Chef Test Kitchen and the process times out with the message:   Waiting for SSH service on …:22, retrying in 3 seconds $$$$$$ [SSH] connection failed, terminating (#<Net::SSH::AuthenticationFailed: Authentication failed for user …@…>) >>>>>> ——Exception——- >>>>>> Class: Kitchen::ActionFailed >>>>>> Message: 1 actions failed. …

Failed to complete #create action: [undefined method `version’ for nil:NilClass] on …

When you execute kitchen converge to launch an EC2 instance in AWS with Chef Test Kitchen, you get the error message: >>>>> ——Exception——- >>>>>> Class: Kitchen::ActionFailed >>>>>> Message: 1 actions failed. >>>>>> Failed to complete #create action: [undefined method `version’ for nil:NilClass] on … >>>>>> ———————- >>>>>> Please see .kitchen/logs/kitchen.log for more details >>>>>> Also …

Could not load the ‘vagrant’ driver from the load path

When you execute the kitchen converge command to launch a virtual machine on your workstation with the Vagrant driver, you may get the error message: >>>>> ——Exception——- >>>>>> Class: Kitchen::ClientError >>>>>> Message: Could not load the ‘vagrant’ driver from the load path. Please ensure that your driver is installed as a gem or included in …

Vagrant installation

 Vagrant Installation Warning! The new versions of Vagrant delete the contents of the /opt/vagrant directory. If you want to keep old versions of Vagrant, first move them out of the /opt directory. Download Vagrant from https://www.vagrantup.com/ and follow the instructions to install it. Select DOWNLOAD… Select the operating system of your workstation. For Ubuntu: Debian RedHat: Centos …