What you have there is one way but by default WinRM only allows local 
administrators to connect to the host so you need to make sure you either 
the domain user is also a local admin or adjust the WinRM security to allow 
non-admins to connect.

Another option is to define the host twice in your inventory like so

[windows]
serverA_local  ansible_host=serverA.internal.domain ansible_user=administrator 
ansible_password=pass
serverA_domain  ansible_host=serverA.internal.domain ansible_user=DOMAIN\user 
ansible_password=pass

[windows:vars]
ansible_connection=winrm
ansible_port=5985

In your play you would set hosts: serverA_local for the local inventory 
entry and hosts: serverA_domain for the domain inventory.

Thanks

Jordan

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/24eea4bf-9db7-4932-98bb-e48a3c8879ac%40googlegroups.com.

Reply via email to