I'm trying to follow this to fetch inventory in us-east-1
region. I downloaded the EC2 External Inventory script and made it executable. My ~/.boto
looks like following.
[Credentials]
aws_access_key_id = <ACCESS_KEY>
aws_secret_access_key = <SECRET_KEY>
Where <ACCESS_KEY>
and <SECRET_KEY>
have real aws access and secret key values respectively.
When I run following command I get an error instead of list nodes in the region.
$ ansible -i ec2.py -u ubuntu us-east-1 -m ping
File "/home/waseem/Repositories/Learning/Ansible/ec2.py", line 168
print data_to_print
^
SyntaxError: invalid syntax
ERROR: failed to parse executable inventory script results: {'msg': '', 'failed': True, 'parsed': False}
What am I doing wrong?