Linux Command Node: CentOs 6, Ansible 2.1, Python 2.7.13
Windows Remote Nodes: Windows 7, Powershell 3.0
Encryption: SSL
So far I’ve figured out how to use these tricks in my playbook to do stuff on the remote Windows node from the command node. Are there other methods I’ve left out?
Avoid using the raw module, use win_command or win_shell instead, you can’t use become or environment variables with raw
Use win_command when you are running an executable, avoid using this when running shell commands like dir, del or PowerShell cmdlets like New-Item, Copy-Item and so on
Use win_shell when you are running shell commands or powershell cmdlets, avoid using this to run executables as you need to deal with shell escaping for complex arguments
For tasks that give you an access is denied, use become to run it like it would locally (not experimental as of the 2.5 release)
`
this does not work and leads to an access is denied error
If there is not an Windows module to complete a task you are looking for, look to see if there is an DSC resource instead (PowerShell v5 or newer is required)
e.g. to manage Hyper-V you can use the DSC resource like so