salt.states.win_update

Management of the windows update agent

2014.7.0 新版功能.

Set windows updates to run by category. Default behavior is to install all updates that do not require user interaction to complete.

Optionally set category to a category of your choice to only install certain updates. Default is to set to install all available updates.

The following example will install all Security and Critical Updates, and download but not install standard updates.

updates:
  win_update.installed:
    - categories:
      - 'Critical Updates'
      - 'Security Updates'
    - skips:
      - downloaded
  win_update.downloaded:
    - categories:
      - 'Updates'
    - skips:
      - downloaded

You can also specify a number of features about the update to have a fine grain approach to specific types of updates. These are the following features/states of updates available for configuring:

'UI' - User interaction required, skipped by default
'downloaded' - Already downloaded, included by default
'present' - Present on computer, skipped by default
'installed' - Already installed, skipped by default
'reboot' - Reboot required, included by default
'hidden' - Skip updates that have been hidden, skipped by default
'software' - Software updates, included by default
'driver' - driver updates, included by default

The following example installs all driver updates that don't require a reboot: .. code-block:: yaml

gryffindor:
win_update.installed:
  • skips: - driver: True - software: False - reboot: False

To just update your windows machine, add this your sls:

class salt.states.win_update.PyWinUpdater(categories=None, skipUI=True, skipDownloaded=False, skipInstalled=True, skipReboot=False, skipPresent=False, skipSoftwareUpdates=False, skipDriverUpdates=False, skipHidden=True)
AutoSearch()
Download()
GetAvailableCategories()
GetCategories()
GetDownloadResults()
GetInstallationResults()
Install()
Search(searchString)
SetCategories(categories)
SetSkip(skip, state)
SetSkips(skips)
salt.states.win_update.downloaded(name, categories=None, skips=None, retries=10)

Cache updates for later install.

name:
if categories is left empty, it will be assumed that you are passing the category option through the name. These are separate because you can only have one name, but can have multiple categories.
categories:

the list of categories to be downloaded. These are simply strings in the update's information, so there is no enumeration of the categories available. Some known categories:

Updates
Windows 7
Critical Updates
Security Updates
Update Rollups
skips:

a list of features of the updates to cull by. Available features:

'UI' - User interaction required, skipped by default
'downloaded' - Already downloaded, skipped by default (downloading)
'present' - Present on computer, included by default (installing)
'installed' - Already installed, skipped by default
'reboot' - Reboot required, included by default
'hidden' - skip those updates that have been hidden.
'software' - Software updates, included by default
'driver' - driver updates, skipped by default
retries
Number of retries to make before giving up. This is total, not per step.
salt.states.win_update.installed(name, categories=None, skips=None, retries=10)

Install specified windows updates.

name:
if categories is left empty, it will be assumed that you are passing the category option through the name. These are separate because you can only have one name, but can have multiple categories.
categories:

the list of categories to be downloaded. These are simply strings in the update's information, so there is no enumeration of the categories available. Some known categories:

Updates
Windows 7
Critical Updates
Security Updates
Update Rollups
skips:

a list of features of the updates to cull by. Available features:

'UI' - User interaction required, skipped by default
'downloaded' - Already downloaded, skipped by default (downloading)
'present' - Present on computer, included by default (installing)
'installed' - Already installed, skipped by default
'reboot' - Reboot required, included by default
'hidden' - skip those updates that have been hidden.
'software' - Software updates, included by default
'driver' - driver updates, skipped by default
retries
Number of retries to make before giving up. This is total, not per step.