Installation of Windows Updates using the Windows Update Agent
New in version 2017.7.0.
Salt can manage Windows updates via the "wua" state module. Updates can be installed and removed. Update management declarations are as follows:
For installation:
# Install a single update using the KB KB3194343: wua.installed # Install a single update using the name parameter install_update: wua.installed: - name: KB3194343 # Install multiple updates using the updates parameter and a combination of # KB number and GUID install_updates: wua.installed: - updates: - KB3194343 - bb1dbb26-3fb6-45fd-bb05-e3c8e379195c
For removal:
# Remove a single update using the KB KB3194343: wua.removed # Remove a single update using the name parameter remove_update: wua.removed: - name: KB3194343 # Remove multiple updates using the updates parameter and a combination of # KB number and GUID remove_updates: wua.removed: - updates: - KB3194343 - bb1dbb26-3fb6-45fd-bb05-e3c8e379195c
Ensure Microsoft Updates are installed. Updates will be downloaded if needed.
Parameters: |
---|
Note
Identifiers can be the GUID, the KB number, or any part of the Title of the Microsoft update. GUIDs and KBs are the preferred method to ensure you're installing the correct update.
Warning
Using a partial KB number or a partial Title could result in more than one update being installed.
Returns: | A dictionary containing the results of the update |
---|---|
Return type: | dict |
CLI Example:
# using a GUID install_update: wua.installed: - name: 28cf1b09-2b1a-458c-9bd1-971d1b26b211 # using a KB install_update: wua.installed: - name: KB3194343 # using the full Title install_update: wua.installed: - name: Security Update for Adobe Flash Player for Windows 10 Version 1607 (for x64-based Systems) (KB3194343) # Install multiple updates install_updates: wua.installed: - updates: - KB3194343 - 28cf1b09-2b1a-458c-9bd1-971d1b26b211
Ensure Microsoft Updates are uninstalled.
Parameters: |
---|
Note
Identifiers can be the GUID, the KB number, or any part of the Title of the Microsoft update. GUIDs and KBs are the preferred method to ensure you're uninstalling the correct update.
Warning
Using a partial KB number or a partial Title could result in more than one update being removed.
Returns: | A dictionary containing the results of the removal |
---|---|
Return type: | dict |
CLI Example:
# using a GUID uninstall_update: wua.removed: - name: 28cf1b09-2b1a-458c-9bd1-971d1b26b211 # using a KB uninstall_update: wua.removed: - name: KB3194343 # using the full Title uninstall_update: wua.removed: - name: Security Update for Adobe Flash Player for Windows 10 Version 1607 (for x64-based Systems) (KB3194343) # Install multiple updates uninstall_updates: wua.removed: - updates: - KB3194343 - 28cf1b09-2b1a-458c-9bd1-971d1b26b211
Ensure Microsoft Updates that match the passed criteria are installed. Updates will be downloaded if needed.
This state allows you to update a system without specifying a specific update to apply. All matching updates will be installed.
Parameters: |
|
---|---|
Returns: |
A dictionary containing the results of the update |
Return type: |
CLI Example:
# Update the system using the state defaults update_system: wua.uptodate # Update the drivers update_drivers: wua.uptodate: - software: False - drivers: True - skip_reboot: False # Apply all critical updates update_critical: wua.uptodate: - severities: - Critical
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.win_wua.html