Generate the Chef cookbook dependency diagram
The Brew viz command reads the Berksfile.lock in the current Chef cookbook directory and saves the cookbook dependency diagram in the graph.png file. The command requires the graphviz utility Install graphviz In the terminal window execute Generate the…
Failed to complete #create action: [You are not authorized to perform this operation
When launching an instance in AWS with Chef Test Kitchen you get the error message >>>>>> Failed to complete #create action: [You are not authorized to perform this operation. Encoded authorization failure message:... Make sure the image does not require…
RuntimeError: Volume vol-… attached at xvdf but does not conform to this resource’s specifications
When the Chef aws cookbook’s ebs_volume.rb resource tries to bring a volume online, partition, and format it we get the error message: RuntimeError: Volume vol-… attached at xvdf but does not conform to this resource’s…
Migrating from Chef Client version 13 to 15
Syntax changes There are breaking changes between Chef Client version 13 and the newer versions, make sure you update your Chef cookbooks to make them work with the new version of the Chef Client. Resource Since version Old syntax New syntax Notes logger…
Set the environment name in Chef Test Kitchen
To specify the environment name in the .kitchen.yml file Create a JSON environment file. Chef Zero used by Test Kitchen does not understand YAML or Ruby, we need to use JSON. In your cookbook’s root directory create a directory for environment…
TypeError no implicit conversion of String into Integer
When we test a Chef cookbook in Chef Test Kitchen and get the error message TypeError ——— no implicit conversion of String into Integer Check if all attribute references have the “node” keyword in front of them.
warning: Insecure world writable dir … in PATH, mode 040777
When you test your Chef cookbook in Test Kitchen you may get the following warning: warning: Insecure world writable dir MY_DIRECTORY/PATH in PATH, mode 040777 To stop this warning message, execute
Chef Test Kitchen converge pauses with Transferring files to <...>
The first step of the Chef Test Kitchen converge operation is to transfer the cookbooks to the instance. If any of the cookbooks contain large files, the operation can take minutes while the terminal displays the message Transferring files to <…
Change the AWS account to launch instances with Chef Test Kitchen
The Chef SDK contains Test Kitchen, that can launch server instances to test your Chef cookbooks. Test Kitchen uses the “chef_zero” provisioner to use your workstation as the virtual Chef server. To switch Test Kitchen to launch instances in…
Test Chef cookbooks locally on a virtual workstation
When you use a virtual machine to write your Chef cookbooks you may want to test them locally with Vagrant. This nested virtual machine cannot use a 64 bit operating system, because to run a 64 bit virtual machine, the host computer’s CPU has to…