Ansible Playbook for Windows Patching

144 views
Skip to first unread message

Jitendra Ingale

unread,
Nov 10, 2021, 8:24:40 AM11/10/21
to Ansible Development
Folks,

I am using below pasted playbook for windows server patching which has variable file defined along with.
It is supposed to take KB number mentioned in variable file and install it on server, followed by server reboot.

Problem is that, the said playbook is getting executed without any issue and also rebooting the server however its not installing mentioned KB patches on server as expected.

Please suggest.

Playbook
---
- hosts: win
  vars_files:
    - patch_list1.yml
  tasks:
          - name: Install only particular updates based on the KB numbers
            win_updates:
              category_names:
                - SecurityUpdates
                - CriticalUpdates
                - UpdateRollups
                - DefinitionUpdates
                - Updates
                - Application
                - Connectors
                - DeveloperKits
                - FeaturePacks
                - Guidance
                - ServicePacks
                - Tools
                - UpdateRollups

              whitelist: "{{ kb_list|default(omit,true )}}"
              log_path: C:\WinUpdates.txt
                    #  - debug: msg " It's rebooting "
          - name: Rebooting the machine
            win_reboot:


Variable File (patch_list1.yml)
kb_list: [KB5006065, KB890830]
Reply all
Reply to author
Forward
0 new messages