Chef and non-zero return codes

When installing a windows package using the windows_package resource the install may report a failure if the non zero return code is considered to be an installation failure.

In my example, the package would return the code 3010, which states a restart is required to complete the installation. However, we can use the success_code attribute parameter for the resource to set an array of possible successful return codes, which by default is 0,42 and 127.

So in order to prevent the package reporting a failure, the following example can be used by including the return code 3013 in the array. For Example:

windows_package 'package_name' do 
success_code [0,42,127,3013]
...
end

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s