It could be- I've heard reports that cloning the box *after* enabling wsman can cause issues if you don't reconfigure stuff (see https://github.com/ansible/ansible/pull/15275), though I've not experienced this issue myself.
Regardless, it appears that the issue lies somewhere with the machine's configuration, not on the the Ansible side. Both the event logs and the occasional "Connection Refused" corroborate this, as a refused connection is not a timeout- it's the target machine actively saying "go away". I'm curious if it starts working smoothly if you use the version of the script in the pull request above on a machine that's having trouble (run it with -ForceNewSSLCert true). Seems odd that it would work sporadically though. If the updated script *does* fix the issue, you'd need to rig up a way to run it on first boot of the new machine (you didn't specify your virtualization/cloning tech, but lots of ways to do that). On Thursday, April 28, 2016 at 11:40:45 PM UTC-7, Deepa Yr wrote: > > Thanks for the inputs. > > I noticed Event viewer.The WinRM service is not listening for > WS-Management requests. > > User Action > If you did not intentionally stop the service, use the following command > to see the WinRM configuration: > > winrm enumerate winrm/config/listener > > Let me explain the things what I have done. > > 1. We provisioned a machine say hostname1, Ran > ConfigureAnsibleForRemoting.ps1 > 2. Took standard image of that machine. > 3.Provisioned new machine say hostname2 using that template > 4. Noticing this winrm connection refused error randomly. > As per the event viewer, suggestion ran winrm enumerate > winrm/config/listener > I see listener running on port 5986 has hostname mentioned as hostname1 . > Will that be a reason for these connection issues ? > > We are Configuring Ansibleremoting first and then taking image as we could > not get an option to run this ConfigureAnsibleForRemoting powershell script > at runtime. As these machines are provisioned runtime. > > -- 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 post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b663c3f4-8ccc-4143-9884-480b61269b3d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
