Windows update install


Greetings Pro’s

There is patching schedule coming around and we need to update our windows machines , we have already configured the wsus settings manually and connected to our intranet,

all i need is a simple recipe to just check and install only the updates / i have referred community cookbooks / box starter and wsus -client which are more complex to work.

is there any powershell script that can be added to recipie would be helpful additionally



I would have a look at for working with windows updates.


You may find this ohai plugin useful for exposing the number of outstanding updates on hosts as well.



Sir appreciate for the immediate response but is there any recipe that can be written like

windows_services ‘Windows Updates’ do
action :download

Windows_services 'windows Update ’ do
action : install

im an beginner to software industry what i did so far is followed the Sops provided by my organisation i am excited to learn more in automation side



My apologies. I gave you the wrong link above. I should have given you the wsus client cookbook and not the server. See Have a read over the readme and I think you will find examples for just what you are trying to do.


Greetings Sir,
Below is the error i get when im trying to run WSUS-Client cookbook ================================================================================ Error executing action download on resource 'wsus_client_update[WSUS updates]‘ ================================================================================ WIN32OLERuntimeError -------------------- (in OLE method Search': ) OLE error code:80072EE6 in <Unknown> <No Description> HRESULT error code:0x80020009 Exception occurred. Cookbook Trace: --------------- c:/chef/cache/cookbooks/wsus-client/providers/update.rb:86:inmethod_missing’ c:/chef/cache/cookbooks/wsus-client/providers/update.rb:86:in block in updates' c:/chef/cache/cookbooks/wsus-client/providers/update.rb:84:intap’ c:/chef/cache/cookbooks/wsus-client/providers/update.rb:84:in updates' c:/chef/cache/cookbooks/wsus-client/providers/update.rb:33:inblock in class_from_file’ Resource Declaration: --------------------- # In c:/chef/cache/cookbooks/wsus-client/recipes/update.rb 32: wsus_client_update ‘WSUS updates’ do 33: action :download 34: end 35: Compiled Resource: ------------------ # Declared in c:/chef/cache/cookbooks/wsus-client/recipes/update.rb:32:in from_file' wsus_client_update("WSUS updates") do action [:download] retries 0 retry_delay 2 default_guard_interpreter :default declared_type :wsus_client_update cookbook_name "wsus-client" recipe_name "update" end System Info: ------------ chef_version=12.21.3 platform=windows platform_version=6.3.9600 ruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32] program_name=C:/opscode/chef/bin/chef-client executable=C:/opscode/chef/bin/chef-client [2017-08-14T09:38:53-04:00] INFO: Running queued delayed notifications before re-raising exception [2017-08-14T09:38:53-04:00] ERROR: Running exception handlers [2017-08-14T09:38:53-04:00] ERROR: Exception handlers complete [2017-08-14T09:38:53-04:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out [2017-08-14T09:38:53-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report [2017-08-14T09:38:53-04:00] FATAL: WIN32OLERuntimeError: wsus_client_update[WSUS updates] (wsus-client::update line 32) had an error: WIN32OLERuntimeError: (in OLE methodSearch’: ) OLE error code:80072EE6 in HRESULT error code:0x80020009 Exception occurred.
ERROR: Failed to execute command on return code 1
ERROR: Bootstrap command returned 1


Does the node have access to the internet? It looks like it’s failing to download updates.


yes it does have access to internet…