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:…
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…
Create the AWS credentials file from a Chef Data Bag
When a process on a server instance needs access to an AWS account, the user who will execute the AWS CLI commands needs to be able to automatically authenticate in AWS. For automatic AWS authentication, the AWS CLI creates two files in the…
Debugging Chef Test Kitchen runs
If there is a configuration error in the Test Kitchen system, there are commands that can help you to get more information. Run the instance creation in debug mode kitchen create -l debug SUITE_NAME
Ruby Gem Management
Ruby gems are Ruby programs and libraries with a name, version and the platform that can execute them. List the installed gems on your system gem list Detailed list that includes the author, homepage, license, install location and a short description gem…
Bootstrap Chef nodes to connect them to the Chef server
A Chef node is a physical or virtual machine with an operating system that is connected to the Chef server. Once the node has made the connection to the Chef server, the installed Chef Client can execute Chef cookbooks to configure the machine.…
Dynamically set Chef resource attributes
When you need to set a Chef resource attribute based on the current state of the environment, there is a way to dynamically provide the value. Set the value of a boolean variable with a test, Declare the Chef resource and assign a reference to it to a…
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 Attributes
Chef attributes are global variables that are available for every cookbook on the node. There are multiple formats to declare and use an attribute. For important notes on the syntax, please see Undefined method or attribute error in a Chef recipe. To…