At some point in Ansible 2.0.x, the '{{ansible_user}}' variable would 
reflect the argument passed to ansible-playbook '-u'.  It doesn't appear to 
be doing this any more, and I can't seem to find a way to obtain the value 
that was passed into '-u'.  Is there a known way to do this?

My specific use-case is that when I create a new EC2 instance, I must wait 
for that instance to come online before I continue my playbook.  I have 
been using a local_action which continually calls an 'ssh' client against 
the remote until I get a successful SSH login.  I realize that most users 
would use a wait_for action, but that has 2 issues:
1) If you don't have direct network-level connectivity to the remote 
machine (eg, you SSH through a proxy)
2) Even if port 22 is up, it doesn't guarantee that the host is ready to be 
logged into (for example, a cloud-init script might need to run in order to 
allow you in)

I figure that the best way to test if the instance can be logged into is to 
actually login to the instance.  I'm open to alternatives if you have them.

Regards,
Mike

-- 
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/39e522b6-9fdd-449e-adf8-345d638125cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to