With the ability to create a Windows window (either Vagrant, VM, or a real machine), configuration is much more important in the first place. Before you create your tutorial, you must have the correct configuration.
Having a Windows window controlled by Vagrant, your group_vars/windows-dev configuration file should contain something like:
ansible_user: IEUser ansible_password: Passw0rd! ansible_port: 55986
Be sure to insert the correct credentials and select the correct port for ansible-port . When working with Vagrant, you can get the correct port from the log messages created by Vagrant after vagrant up . In my case, it looks like this:
==> default: Forwarding ports... default: 5985 (guest) => 55985 (host) (adapter 1) default: 5986 (guest) => 55986 (host) (adapter 1)
My Vagrantfile can be found here if you are interested. It uses the Microsoft Edge image on Windows 10 Stable (14.xxx) from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms .
Now the win_ping module should work - provided that you have completed all the necessary preparation steps on your Windows box, in the center of which executing the ConfigureRemotingForAnsible.ps1 script (for more information, see the Finished Windows Ansible ready chapter in this blog post ):
ansible windows-dev -i hostsfile -m win_ping
Only if it gives you SUCCESS should you start creating your play.
source share