Create a new server image for a RightScale server template

The RightScale server templates publish server images to launch. It is advisable to create your own server image because the cloud providers can remove their published images anytime. If you generate your own image, you control the lifecycle of those. Create your own server image Use Packer to create a new server image. Install RightLink. On …

windows_task, ArgumentError: invalid date

When the windows_task resource is called to “create” a Windows Scheduled Task that already exists, an error message is returned. In the past, the “modify” action was responsible for the modification of the scheduled tasks, since Chef 13 the “create” action would update the task if exists. ArgumentError: …[…] (…:… line …) had an error: ArgumentError: …

.NET Framework Detection in the Windows Registry

To determine which .NET framework is installed on the Windows computer check the values in the registry. The HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full key contains two values you can check: Release Version You can use InSpec, part of the Chef DK, to check the values: describe registry_key(‘HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full’) do it { should have_property ‘Release’ } it { …

Chef exit codes

Chef uses the standard RFC 062 exit codes. In your .kitchen.yml file, you can supply an array of exit codes in the “retry_on_exit_code” option to retry the operation in case the Chef script execution is interrupted. The usual values are retry_on_exit_code: # An array of exit codes that can indicate that kitchen should retry the converge …

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 …

amazon-ebs: Error waiting for SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

When you launch a Linux AWS EC2 instance with Terraform or create a Linux AWS image with Packer, one of the following errors are displayed: amazon-ebs: Error waiting for SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain aws_instance.default: 1 error(s) occurred: * ssh: handshake failed: ssh: unable to …

delimited by end-of-file (wanted `EOF’)

When you create a file in a script and use an end of file delimiter, if … cat <<EOF> $chef_dir/attrib.json $json EOF fi and you indent the word EOF to look nicer, you will get the error message warning: here-document at line … delimited by end-of-file (wanted `EOF’) STDERR> …: line …: syntax error: unexpected end of file …

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 …