I am successful executing ansible against an AWS ec2 when I put the public IP in the /etc/ansible/hosts file. However, when I replace that with the ec2 hostname, ansible complains with:
There's also some ec2.ini configuration that controls whether Ansible uses
private or public addresses or names to refer to your instances, and the
ability to have Ansible use one thing for inventory_hostname and another
for the actual SSH connection. Which combination of things you want
depends on what you're doing, e.g. Ansible running on the same private
network as your instances or not, etc.
-Josh (jbs@care.com)
(apologies for the automatic corporate disclaimer that follows)
This email is intended for the person(s) to whom it is addressed and may contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, distribution, copying, or disclosure by any person other than the addressee(s) is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email and delete the message and any attachments from your system.
However, I don't think that is the issue, within the ini file I do have:
destination_variable = public_dns_name
Mm. And can you in fact SSH to your instances from your Ansible control
host by their public DNS names?
-Josh (jbs@care.com)
This email is intended for the person(s) to whom it is addressed and may contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, distribution, copying, or disclosure by any person other than the addressee(s) is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email and delete the message and any attachments from your system.