win_updates keeps failing on some updates

I am using win_updates to deploy patches to machines, and I have a whole list of patches to deploy to machines in a whitelist.

I am seeing an issue sometimes where the machine I try to deploy the patches to is getting Download Result 4 error, and the win_updates module fails to complete.

As an example, I have a list of patches to install, and I get KB2813430 is causing Download Result 4 error. I remove that patch from the list, and I re-run the win_updates, and it works, and then afterwards, when I try to run the win_updates with that KB2813430 patch again, it works. It seems like there is some unresolved dependencies in the order of which the patches get installed with the Ansible module does not know about?

I’ve seen some weirdness on windows update with ansible before and usually use a register (test with a debug to see the return values) and do a retry every 60-90s 10x with an until: statement based on the register returning found_update_count: 0 or something of that nature. I don’t have an exact copy of whatever it was that was working anywhere to share at the moment, but if you play around with some of the return values, I’m sure you can find a method to achieve a successful outcome.