# trying vagrant + ansible for windows server target. cant win\_ping

**URL:** <https://forum.ansible.com/t/trying-vagrant-ansible-for-windows-server-target-cant-win-ping/27444>\
**Category:** Ansible Project\
**Tags:** windows, ubuntu\
**Created:** [May 3, 2018, 9:17pm UTC](https://forum.ansible.com/t/trying-vagrant-ansible-for-windows-server-target-cant-win-ping/27444 "2018-05-03T21:17:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixel\_fairy](https://avatars.discourse-cdn.com/v4/letter/p/6f9a4e/32.png) [@pixel\_fairy](https://forum.ansible.com/u/pixel_fairy)\
**Post date:** [May 3, 2018, 9:17pm UTC](https://forum.ansible.com/t/trying-vagrant-ansible-for-windows-server-target-cant-win-ping/27444/1 "2018-05-03T21:17:59Z")

</div>

host: ubuntu-16.04  
vagrant: 2.0.4  
vagrant-hostmanager (1.8.8)  
vagrant-libvirt (0.0.43)  
vagrant-mutate (1.2.0)  
vagrant-sshfs (1.3.1)

there is a virtualbox version of the same windows box. used pip to update winrm (and also had to use pip for openssl) same results without the pywinrm warning.

`

VAGRANTFILE\_API\_VERSION = “2”

Vagrant.configure(VAGRANTFILE\_API\_VERSION) do |config|  
config.vm.box = “peru/windows-server-2012-r2-standard-x64-eval”  
config.vm.provider “libvirt” do |libvirt|  
libvirt.input type: “tablet”, bus: “usb”  
libvirt.graphics\_type = “vnc”  
end  
config.vm.provision “shell”, path: “ConfigureRemotingForAnsible.ps1”  
config.vm.provision “ansible”, playbook: “site.yml”  
end  
`

ansible setup script at [https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1](https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1)

site.yml:

`  
hosts: all  
vars:  
ansible\_winrm\_scheme: http  
ansible\_winrm\_server\_cert\_validation: ignore  
tasks:

- name: ping  
win\_ping:  
`

` `  
$ vagrant up

Bringing machine ‘default’ up with ‘libvirt’ provider…  
==\> default: Checking if box ‘peru/windows-server-2012-r2-standard-x64-eval’ is up to date…  
==\> default: Uploading base box image as volume into libvirt storage…  
==\> default: Creating image (snapshot of base box volume).  
==\> default: Creating domain with the following settings…  
==\> default: – Name: winping\_default  
==\> default: – Domain type: kvm  
==\> default: – Cpus: 1  
==\> default:  
==\> default: – Feature: acpi  
==\> default: – Feature: apic  
==\> default: – Feature: pae  
==\> default: – Memory: 2048M  
==\> default: – Management MAC:  
==\> default: – Loader:  
==\> default: – Base box: peru/windows-server-2012-r2-standard-x64-eval  
==\> default: – Storage pool: default  
==\> default: – Image: /var/lib/libvirt/images/winping\_default.img (50G)  
==\> default: – Volume Cache: default  
==\> default: – Kernel:  
==\> default: – Initrd:  
==\> default: – Graphics Type: vnc  
==\> default: – Graphics Port: -1  
==\> default: – Graphics IP: 127.0.0.1  
==\> default: – Graphics Password: Not defined  
==\> default: – Video Type: qxl  
==\> default: – Video VRAM: 9216  
==\> default: – Sound Type: ich6  
==\> default: – Keymap: en-us  
==\> default: – TPM Path:  
==\> default: – INPUT: type=tablet, bus=usb  
==\> default: – CHANNEL: type=unix, mode=  
==\> default: – CHANNEL: target\_type=virtio, target\_name=org.qemu.guest\_agent.0  
==\> default: – CHANNEL: type=spicevmc, mode=  
==\> default: – CHANNEL: target\_type=virtio, target\_name=com.redhat.spice.0  
==\> default: – RNG device model: random  
==\> default: Creating shared folders metadata…  
==\> default: Starting domain.  
==\> default: Waiting for domain to get an IP address…  
==\> default: Waiting for SSH to become available…  
==\> default: Forwarding ports…  
==\> default: 3389 (guest) =\> 3389 (host) (adapter eth0)  
==\> default: 5986 (guest) =\> 5986 (host) (adapter eth0)  
==\> default: 5985 (guest) =\> 55985 (host) (adapter eth0)  
==\> default: Configuring and enabling network interfaces…  
==\> default: Running provisioner: shell…  
default: Running: ConfigureRemotingForAnsible.ps1 as c:\tmp\vagrant-shell.ps1  
==\> default: Running provisioner: ansible…  
Vagrant has automatically selected the compatibility mode ‘2.0’  
according to the Ansible version installed (2.5.1).

Alternatively, the compatibility mode can be specified in your Vagrantfile:  
https://[www.vagrantup.com/docs/provisioning/ansible\_common.html#compatibility\_mode](http://www.vagrantup.com/docs/provisioning/ansible_common.html#compatibility_mode)

default: Running ansible-playbook…

PLAY [all] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
[WARNING]: ansible\_winrm\_server\_cert\_validation unsupported by pywinrm (is an  
up-to-date version of pywinrm installed?)

fatal: [default]: UNREACHABLE! =\> {“changed”: false, “msg”: “plaintext: [Errno 104] Connection reset by peer”, “unreachable”: true}  
to retry, use: --limit @/home/shared/vagrant/winping/site.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
default : ok=0 changed=0 unreachable=1 failed=0

Ansible failed to complete successfully. Any error output should be  
visible above. Please fix these errors and try again.

` `  
`also tried with ansible_winrm_scheme: https`

`  
==\> default: Running provisioner: shell…  
default: Running: ConfigureRemotingForAnsible.ps1 as c:\tmp\vagrant-shell.ps1  
==\> default: Running provisioner: ansible…  
Vagrant has automatically selected the compatibility mode ‘2.0’  
according to the Ansible version installed (2.5.1).

Alternatively, the compatibility mode can be specified in your Vagrantfile:  
https://[www.vagrantup.com/docs/provisioning/ansible\_common.html#compatibility\_mode](http://www.vagrantup.com/docs/provisioning/ansible_common.html#compatibility_mode)

default: Running ansible-playbook…

PLAY [all] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
[WARNING]: ansible\_winrm\_server\_cert\_validation unsupported by pywinrm (is an  
up-to-date version of pywinrm installed?)

fatal: [default]: UNREACHABLE! =\> {“changed”: false, “msg”: “ssl: 500 WinRMTransport. [SSL: CERTIFICATE\_VERIFY\_FAILED] certificate verify failed (\_ssl.c:590)”, “unreachable”: true}  
to retry, use: --limit @/home/shared/vagrant/winping/site.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
default : ok=0 changed=0 unreachable=1 failed=0

Ansible failed to complete successfully. Any error output should be  
visible above. Please fix these errors and try again.

`

---

<div class="post-metadata">

**Author:** ![Tom\_Rota](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@Tom\_Rota](https://forum.ansible.com/u/Tom_Rota)\
**Post date:** [May 5, 2018, 9:42am UTC](https://forum.ansible.com/t/trying-vagrant-ansible-for-windows-server-target-cant-win-ping/27444/2 "2018-05-05T09:42:39Z")

</div>

Have you tried letting vagrant bring the box up without running the ansible portion of provisioning, getting your command prompt back, and then running ansible-playbook site.yml -vvvvv ?

---

<div class="post-metadata">

**Author:** ![pixel\_fairy](https://avatars.discourse-cdn.com/v4/letter/p/6f9a4e/32.png) [@pixel\_fairy](https://forum.ansible.com/u/pixel_fairy)\
**Post date:** [May 6, 2018, 12:52am UTC](https://forum.ansible.com/t/trying-vagrant-ansible-for-windows-server-target-cant-win-ping/27444/3 "2018-05-06T00:52:03Z")

</div>

Yes, but without so much verbose.

turns out to be a known bug in pywinrm, fixed in current tree. installing from github fixed it.

if you have the same problem, wait till pywinrm-0.3.1 (or whatever version) is out, or

`git clone https://[github.com/diyan/pywinrm](http://github.com/diyan/pywinrm) cd pywinrm pip install --upgrade .`

then just pip upgrade as usual when the fix is released.
