One of the idiosyncrasies when using Windows is the vast array of error codes it provides so for many installers you will need to determine this by looking at their documentation. This isn’t a problem in the Unix/Linux world generally as installers generally respect the notion of 0 for success and 1 for failure. Chef can’t determine these dynamically any better than yourself as Windows installers that aren’t MSI/MSU are relatively non-standard and can do anything they choose.
is there any way to to apply not_if condition if group exists
group ‘ora_dba’ do
members [‘oracle’,‘oraclebatch’]
append true
action :create
not_if {group.exist?(‘ora_dba’)}
end
One of the core tenets of Chef is that it doesn't need to do work it's already done - recipes and resources are different from scripts in this regard, the resource will always create the group if needed but if it already exists and has no inputs, then there is nothing to do. This is a core concept of Chef and applies to all resources, save a few like execute or script which you need to guard yourself.
windows_package ‘setup.exe’ do
source "#{setupexe}"
installer_type :custom
options '-silent -nowelcome -nowait -noconfig -responseFile D:\database\response\db.rsp’
action :install
returns 259
end
this installation taking 15 mins to complete approx. But chef run is getting completed in 5 sec and resource after this like db creation on this software will run only when installation is completed. but chef will run other resource before the installation is completed.
I use Chocolatey for app installs. I really like it, command line for one offs and a Chef resource thats been working for me. Also many packages are already made by the community.