Based on feedback we have received this week we will cover Ansible and today I will show you how to install Windows Updates using Ansible for Windows.
This post will show you a playbook that installs Windows updates on a managed Windows machines without needing to use WSUS. The playbook installs Security, Definition, critical and rollup updates and restarts the machine if needed.
Below you can see the code.
--- - name: "Windows Updates" hosts: windows tasks: - name: Install Windows updates win_updates: category_names: - SecurityUpdates - CriticalUpdates - UpdateRollups - DefinitionUpdates reboot: yes
Note: To install all the update types use the following list.
- SecurityUpdates - CriticalUpdates - UpdateRollups - DefinitionUpdates - updates - FeaturePacks - Servicepacks - Tools - Application