Finny Thomas
Finny Thomas

Reputation: 25

Source for package SQLServer2012SP4KB4018073x64ENU.exe does not exist in chef

i am trying to install sql server 2012 using chef to a virtual box.. Below is the code that i use but i am getting source does not exist error. Below is the server.rb code that i have..


package package_name do
  source 'C:\Users\user\AppData\Local\Temp\SQLServer2012SP4KB4018073x64ENU.exe'# package_url
  checksum package_checksum
  timeout node['sql_server']['server']['installer_timeout']
  installer_type :custom
  options "/q /ConfigurationFile=#{config_file_path} #{passwords_options}"
  action :install
  notifies :request_reboot, 'reboot[sql server install]'
  returns [0, 42, 127, 3010]

Error

 * template[C:\Users\vagrant\AppData\Local\Temp\kitchen\cache\ConfigurationFile.ini] action create (up to date)
 windows_package[SQLServer2012SP4KB4018073x64ENU.exe] action install
 * Source for package SQLServer2012SP4KB4018073x64ENU.exe does not exist

Upvotes: 1

Views: 121

Answers (1)

seshadri_c
seshadri_c

Reputation: 7340

Aside from making the file accessible for windows_package resource, one more change can be made.

The name of windows_package resource should match the application name displayed in Control Panel. As you are using SQLServer2012SP4KB4018073x64ENU.exe as the name, Chef will start installation of the package every time it is run (which is probably not what we want).

For e.g. if I want to install a simple package like WinSCP, which is displayed in Control Panel as WinSCP <version>, then I should name my resource with that.

windows_package 'WinSCP 5.17.7' do
  source 'C:\Users\Administrator\Downloads\WinSCP-5.17.7-Setup.exe'
  installer_type :custom
  options '/silent'
end

Now if Chef runs again, it will make this install idempotent.

Upvotes: 1

Related Questions