I’m running version 2.3 (can’t update to 2.4 just yet) and, despite what should be super stupid simple, I’ve never been able to get win_package to work. I’ve changed up my win_package play in every conceivable way, but no joy. Here’s my basic set-up, which is taken directly from the doc:
You figured out that the path shouldn’t have the end single quote, unless you are start the path with a single quote. No need to escape the backslashes unless you enclose it in double quotes
While you specify the path as .msu, win_package doesn’t have any smarts in place to automatically use wusa.exe to install the hotfix, you need to modify the path and arguments to use wusa.exe
There is the win_hotfix module in 2.4 but this isn’t available for Server 2008, 2008 R2 without lots of messing around so for this hotfix it probably won’t matter but I’ve included an example anyway
The final issue is that on a WinRM process any access to the Windows Update API like wusa.exe will fail with access is denied, you need to escape the Network Logon process to get it working, there are multiple ways of doing this currently
Use Ansible and become to become an interactive process, while this was added in 2.3 it was experimental and only worked in certain situations. I would recommend you upgrade to 2.5 when it is out as it is no longer experimental and quite easy to use
Use a scheduled task to run the process, this works but it quite cumbersome to setup and run so I won’t give an example
Use psexec and the win_psexec module, it requires the psexec executable downloaded onto the host and chocolately can do that for you
Because you are on an older Ansible version the psexec option will be the easiest way for you to move forward so I recommend you look into that.
`
on 2.5 you could do the following for most Windows hosts
name: reboot if required
win_reboot:
when: hotfix_install.reboot_required
or from 2.4 onwards and Server 2012 or newer you can use win_hotfix (I know this is for Server 2008 R2 but keeping it here as an example for other updates)