win_mapped_drive is/was failing

Thought I would just mention this as it’s been driving me crazy all morning… and I still haven’t really got it working

I was using win_mapped drive to map a network drive for a user so that it would be available for that user when they logon.

This was working fine on my test rig at home, pretty sure it was anyway.

Now I am trying to implement in my prod environment and I am having problems.

Windows 2016. These VMs are workers in our environment. They run some command based exe’s in a command window kicked off by a java wrapper for better words.

In order for that to work we have an account that is automatically logged onto the computer… the account is in the local administrator account of the computer.

I discovered that the win_mapped_drive fails if the user is logged onto the computer - Module Failed message.

So when I finally backtracked and logged the user off the computer and ran it again, the mapping appears to work… except the drive is not mapped.

I am using become and the user in the become is the user that logs onto the computer and should have the mapped drive.

I am also using the same users credentials when mapping the drive. It is a domain user.

I understand that this mapped drive is not available during the ansible session and that’s not what I am trying to do. I just want the drive to be mapped when the user is auto logged on.

I’m kind of running out of ideas as the recap says it changed ok and I am now just running a playbook with just this command in it.

Thanks
Bill