During major Chef Client version upgrades, some instructions need to be changed based on the version of the Chef Client. For example, upgrading from version 12 to version 13, the “windows_task” resource requires a different action to make changes to existing scheduled tasks. To call a Chef resource in your cookbook, you need another resource to …
Author Archives: Laszlo Pinter
Make decisions in your Chef recipe based on the version of the Chef Client
There are times when you have to make a decision in your Chef recipe, based on the version of the Chef Client installed on the node. There are two ways to get the version of the installed Chef Client: Chef::VERSION node[‘chef_packages’][‘chef’][‘version’] To make a decision based on the installed Chef Client version if ( Chef::VERSION.to_f …
Continue reading “Make decisions in your Chef recipe based on the version of the Chef Client”
Knife commands
Knife is a ChefDK command line tool to access the Chef server. We use it to upload our cookbooks, environment files, and data bags to the Chef server, and query the server for information on cookbooks and nodes. Get the list of cookbooks used by a node with version information knife node show <node-name> -a cookbooks
Test your cookbook in Chef Test Kitchen against multiple versions of the Chef Client
In large environments, during the Chef Client version change, some older servers still run the prior version of the Chef Client, the newly created servers launch with the new version of the Chef Client. It is very important to test your cookbooks with the old and the new versions of Chef Client. To specify the …
Open the system drive of an AWS instance you cannot log into
If you cannot log into an AWS instance and want to inspect files on it, you can detach the volume from the lost instance and attach it to another instance as the secondary drive. Create a new instance Create a new AWS instance and log into it, Make a note of the Instance ID of …
Continue reading “Open the system drive of an AWS instance you cannot log into”
Debugging a Packer build
Packer can configure a server instance and create an image of it. If you need to examine what Packer is doing, you can run Packer in debug mode and RDP into the instance to view files and other settings. Open the firewall In the “builders” element add a line to the Packer template to execute …
Install the binary component of LastPass
To be able to download attached files from LastPass, you need to install the binary component for LastPass in your web browser. Navigate to https://lastpass.com/misc_download2.php Install the LastPass for Chrome (full version) plugin
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 …
Continue reading “Create a new server image for a RightScale server template”
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: …
Continue reading “windows_task, ArgumentError: invalid date”
Application error codes
When an application execution fails, it usually returns an error code to specify the cause of the problem. Windows error codes Application Error code Cause Workaround Visual Studio -2147205120 The computer has a pending restart and must be rebooted before the execution. Restart your computer, and then rerun the application.