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

       - name: Copy Patch from Control machine
           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

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:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.