On Fri, 23 Jun 2017, Reiner Nippes wrote:
> I'm starting two ec2 SLES12 instances with ansible. After they are
> up&running the same playbook should configure the machines.
>
> So I inculde
>
> - name: Wait for connection to
> wait_for_connection:
>
> after the ec2: module. Ansible is waiting for connecting some seconds.
> That's OK.
-snip-
> a) Is this a bug in "wait_for_connection:"? (I think yes.)
No, wait_for_connection does a complete end-to-end test by running a
ping/win_ping module on the remote end. If it reports 'ok', then the
service worked without a doubt.
The time-out waiting for a privileged escalation prompt indicates to me
that when the system returns and provides a working transport, that the
privilege escalation is not working yet.
If this is the case, we should be looking at making sure that
wait_for_connection is also using the privilege ecalation. That might be a
solution, but you have to check. Did you try running it as root (without
privilege escalation) or running everything as user.
Does it fail in this case too ?
> b) How to write a playbook that is fail safe?
It appears that somehow on your system the service becomes available, and
then disappears or is blocked again. And that seems to be the problem. If
this has to do with timing and you know it settles afterwards within 15
seconds, you could add a `pause` task.
But the essence here is, you have to figure out what exactly is
happening, before you can come up with a working solution.
--
Dag