Install Windows Updates With Ansible

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.

Last month we covered Ansible for Windows in-depth using the four-part series on how to manage Windows Machine with Ansible.

Windows Updates

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
    - name: Install Windows updates
         - 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

Success! You're on the list.

1 thought on “Install Windows Updates With Ansible”

Comments are closed.