Could it be a security group issue (have you limited your outbound ports etc...?)?
Or DNS? Does the aws console resolved to the same place when digged from inside?
On 2014-01-13 16:57, Mark Casey wrote:
> No change specifically with ec2.py... it doesn't work on the host where I
> wanted to use it, but it does on another host I tried it on.
>
> However, on the host where ec2.py is not working, I thought I'd mention that I
> am able to use boto on the python shell:
>
> ubuntu@ip-172-16-20-21:/etc/ansible$ python
> Python 2.7.3 (default, Sep 26 2013, 20:03:06)
> [GCC 4.6.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import boto.ec2
> >>> conn = boto.ec2.connect_to_region("us-west-2",
> ... aws_access_key_id="redacted",
> ... aws_secret_access_key="redacted")
> >>> reservations = conn.get_all_reservations()
> >>> instances = reservations[1].instances
> >>> inst = instances[0]
> >>> inst.private_dns_name
> u'ip-172-16-20-39.us-west-2.compute.internal'
> >>>
>
> I'm exporting credentials in bash for ec2.py, and added them temporarily to
> /etc/boto.cfg for the test on the console.
>
> Thank you,
> Mark
>
>
> On Monday, January 13, 2014 10:40:00 AM UTC-6, Mark Casey wrote:
>
> I have a role that uses the ec2 module and it is working fine, so I'm
> assuming I'm ok on dependencies like boto... but when I try to run *ec2.py
> --list* I get back:
>
> root@ip-1-1-1-1:/etc/ansible/elastirax# ./ec2.py --list
> Looks like AWS is down again:
> EC2ResponseError: 401 Unauthorized
> <?xml version="1.0" encoding="UTF-8"?>
> <Response><Errors><Error><Code>AuthFailure</Code><Message>AWS was not
> able to validate the provided access
> credentials</Message></Error></Errors><RequestID> removed
> </RequestID></Response>
>
>
> That host is an ec2 instance itself. I tried it on another host (a
> rackspace box) after exporting the credentials the exact same way and the
> problem isn't there; both the role and ec2.py work there.
>
> I've tried comparing installed packages between the two hosts (both Ubuntu
> 12.04.3, ansible 1.4.3) and using pip to make sure I have latest boto, but
> I'm not sure how to troubleshoot from here. Do I need to do something to
> run ec2.py on an ec2 instance...change a url to an internal one or something?
>
> Thanks for any insight/suggestions,
> Mark
>
> --
> 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
ansible-proje...@googlegroups.com.
> To post to this group, send email to
ansible...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
--
Yves.