Hi!
I have some Windows machines set up on virt-manager on Ubuntu and they work great to login to etc. But when I run ansible against it to install things, create an AD domain etc, sometimes ansible does not succeed in connecting to the machine with WinRM even though the WinRM service is running on the machine and the port is open(if I check with netstat). So then I try to restart the machines, and sometimes ansible can then connect to it after reboot but sometimes two or three reboots needed.
Why is this the case? I really want to fix it because otherwise I can’t write a bash script that first runs terraform to create the machines and then ansible to provision them. I tried to reboot all machines in virt-manager after terraform created them, but still it happens that ansible gets stuck at connecting to WinRM for some specific tasks. It may also succeed in creating some tasks but then some fail because that connection hangs and I have to “ctrl+c” and do it again.