0
fatal: [hostname.domain]: FAILED! => {"changed": true, "cmd": "wusa.exe C:\\Temp\\Windows8.1-KB3042553-x64.msu /quiet /norestart", "delta": "0:00:00.109333", "end": "2017-04-11 04:57:09.337190", "failed": true, "rc": 5, "start": "2017-04-11 04:57:09.227857", "stderr": "", "stdout": "", "stdout_lines": [], "warnings": []}
fatal: [hostname.domain]: FAILED! => {"changed": true, "cmd": "wusa.exe C:\\Temp\\Windows8.1-KB3042553-x64.msu /quiet /norestart", "delta": "0:00:00.281051", "end": "2017-04-11 04:57:09.321305", "failed": true, "rc": 5, "start": "2017-04-11 04:57:09.040254", "stderr": "", "stdout": "", "stdout_lines": [], "warnings": []}

Playbook below.

 - hosts: all

   tasks:
       - name: Copy Patch from Control machine
         win_copy:
           src: /tmp/win_updates/
           dest: C:\Temp\

       - name: Extracting Patch on local machine
         win_command: wusa.exe C:\Temp\Windows8.1-KB3042553-x64.msu /extract:C:\Temp

       - name: Installing the Patch on local machine
         win_command: dism.exe /online /add-package /PackagePath:C:\Temp\Windows8.1-KB3042553-x64.cab /NoRestart /quiet

1 Answers1

0

Looks like it's not an ansible problem, but wusa one. Judging by exit code 5, and this MS doc

Installing an update using WUSA or the WUA APIs on a remote machine is not supported.

And ansible uses PowerShell remoting to manage Windows hosts.

See also:

Andrew
  • 228
  • 3
  • 12