msu_package resource

[edit on GitHub]

Use the msu_package resource to install Microsoft Update(MSU) packages on Microsoft Windows machines.

New in Chef Client 12.17.

Syntax

The msu_package resource has the following syntax:

msu_package 'name' do
  source                     String
  action                     Symbol
end

where:

  • msu_package is the resource.
  • name is the name given to the resource block.
  • source is the local path or URL for the MSU package.

The full syntax for all of the properties that are available to the msu_package resource is:

msu_package 'name' do
   source                    String
   checksum                  String
   action                    Symbol
end

Actions

The msu_package resource has the following actions:

:install
Installs the MSU package from either a local file path or URL.
:remove
Uninstalls the MSU package from its location on disk.

Properties

The msu_package resource has the following properties:

checksum

Ruby Type: String

SHA-256 digest used to verify the checksum of the downloaded MSU package.

source

Ruby Type: String

The local file path or URL for the MSU package.

Examples

Using local path in source

msu_package 'Install Windows 2012R2 Update KB2959977' do
  source 'C:\Users\xyz\AppData\Local\Temp\Windows8.1-KB2959977-x64.msu'
  action :install
end
msu_package 'Remove Windows 2012R2 Update KB2959977' do
  source 'C:\Users\xyz\AppData\Local\Temp\Windows8.1-KB2959977-x64.msu'
  action :remove
end

Using URL in source

msu_package 'Install Windows 2012R2 Update KB2959977' do
  source 'https://s3.amazonaws.com/my_bucket/Windows8.1-KB2959977-x64.msu'
  action :install
end
msu_package 'Remove Windows 2012R2 Update KB2959977' do
  source 'https://s3.amazonaws.com/my_bucket/Windows8.1-KB2959977-x64.msu'
  action :remove
end