package_state_windows

This method manage packages using a chocolatey on the system.

⚙️ Compatible targets: Windows

Parameters

NameDocumentation
PackageNameSoftware name to install.

This parameter is required.
Status'present' or 'absent', defaults to 'present'.

Choices:
  • present
  • absent

This parameter is required.
Providerdefault to choco.

Choices:
  • choco

This parameter is optional.
Paramsparams to pass to the package installation.

This parameter is optional.
Versionversion, default to latest.

This parameter is optional.
Sourcesource.

This parameter is optional.
ProviderParamsprovider parameters, default to choco.

This parameter is optional.
AutoUpgradeautoUpgrade, default to false.

Choices:
  • true
  • false

This parameter is optional.

Outcome conditions

You need to replace ${PackageName} with its actual canonified value.

  • ✅ Ok: package_state_windows_${PackageName}_ok
    • ☑️ Already compliant: package_state_windows_${PackageName}_kept
    • 🟨 Repaired: package_state_windows_${PackageName}_repaired
  • ❌ Error: package_state_windows_${PackageName}_error

Example

method: package_state_windows
params:
  Status: present
  Params: OPTIONAL_VALUE
  AutoUpgrade: 'true'
  PackageName: VALUE
  Source: OPTIONAL_VALUE
  ProviderParams: OPTIONAL_VALUE
  Version: OPTIONAL_VALUE
  Provider: choco

Documentation

Install a windows package using a given provider

Parameters

Required args:

  • PackageName Name of target package
  • Status can be "present" or "absent"

Optional args:

  • Provider Provider used to installed the package
  • Params Package parameters, passed to the installer
  • Version can be "any", "latest" or any exact specific version number
  • Source "any" or any specific arch
  • ProviderParams provider specific options
  • AutoUpgrade default set to false

Providers

choco

The method is a simple transcription of the cchoco cChocoPaclageInstaller DSC resource, adapted to Rudder. The DSC module cchoco must be installed on your node before trying to use this method.

You can check the cchoco/chocolatey documentation to get more detailed information on the parameters. WARNING: If some exceptions are thrown about undefined env PATH variable after fresh cchoco lib in rudder, you may need to reboot your machine or notify your system that the env variables have been changed.