Closed rschiefer closed 9 years ago
The default test-kitchen runs invoke chef-client over WinRM. The windows security model does not allow the installation of MSU packages over WinRM.
For more, see https://github.com/test-kitchen/test-kitchen/issues/655#issuecomment-114921207
I've just been struggling with this, some background to the above statement.
Having trawled through https://github.com/chef/chef/issues/1614, they mention there is msu_package since Chef Client 12.17 (https://docs.chef.io/resource_msu_package.html).
I tried modifying recipe/powershell5.rb to say (and the block for 6.1) and it worked for me.
elsif ::Windows::VersionHelper.nt_version(node) > 6.1
msu_package 'Windows Management Framework Core 5.1' do # ~FC009
source node['powershell']['powershell5']['url']
checksum node['powershell']['powershell5']['checksum']
action :install
notifies :reboot_now, 'reboot[powershell]', :immediately if node['powershell']['installation_reboot_mode'] != 'no_reboot'
not_if { ::Powershell::VersionHelper.powershell_version?(node['powershell']['powershell5']['version']) }
end
What does an exit code of '5' mean?
================================================================================ Error executing action
install
on resource 'windows_package[Windows Management Framework Core 5.0]'-x64.msu" /quiet /norestart & exit %%ERRORLEVEL%% ---- STDOUT: STDERR: ---- End output of start "" /wait "C:\Users\ADMINI~1\AppData\Local\Temp\kitchen\cache\WindowsBlue-KB3037315-x 64.msu" /quiet /norestart & exit %%ERRORLEVEL%% ---- Ran start "" /wait "C:\Users\ADMINI~1\AppData\Local\Temp\kitchen\cache\WindowsBlue-KB3037315-x64.msu" /quiet /norestart & exit %%ERRORLEVEL%% returned 5