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 (…).…
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…
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…
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…
Could not load the ‘ec2’ driver from the load path
When you execute kitchen list and the driver in your .kitchen file is “ec2“, the following error message appears: >>>> ——Exception——- >>>>>> Class: Kitchen::ClientError…
No instances for regex `’, try running `kitchen list’ in Chef Test Kitchen
When I tried to execute the “kitchen list” command in Chef Test Kitchen the following error came up: No instances for regex `’, try running `kitchen list’ I could not find the reason for the error, so I opened the…
Berks update fails with ‘Missing artifacts’ error message
When you add cookbooks as dependencies with the “depends” statement to the metadata.rb file of your Chef cookbook, to be able to test your cookbooks in Chef Test Kitchen, you also have to specify the location of those cookbooks in the…
Chef file locations
The Chef file and folder locations are different on Linux and Windows machines. This article explains the purpose of each file and the location. Summary Linux Windows Cookbook location /var/chef/cache/cookbooks C:\chef\cache\cookbooks Chef Client run…
Launch Windows instances locally with Chef Test Kitchen
Most Linux distributions are free, and do not require product keys to launch them. The steps below are based on the great article at http://kitchen.ci/blog/test-kitchen-windows-test-flight-with-vagrant/ I have summarized the steps below to create a free…
`block in filter_instances’: undefined method `empty?’ for nil:NilClass (NoMethodError)
When you try to execute any of the “kitchen” commands in Chef Test Kitchen you may get the following error message. lib/kitchen/config.rb:182:in `block in filter_instances': undefined method `empty?' for nil:NilClass (NoMethodError) This…