Not able ping instances using dynamic inventory

46 views
Skip to first unread message

chall...@gmail.com

unread,
Sep 6, 2016, 5:09:05 PM9/6/16
to Ansible Project

I have downloaded ec2.py and ec2.ini files and placed them under

/etc/ansible/inventory

and i have changed the ansible.cfg to

inventory      = /etc/ansible/inventory/ec2.py

i have environment variables set up as

export AWS_ACCESS_KEY_ID="XXXXXXXXXXXXXXX"
export AWS_SECRET_ACCESS_KEY="XXXXXXXXXXXXXXXXXXXXX"
export AWS_DEFAULT_REGION="us-east-1"
export EC2_INI_PATH="/etc/ansible/inventory/ec2.ini"

now when i run ansible -m ping all i am getting

[WARNING]: provided hosts list is empty, only localhost is available

instead of pinging all instances in my account

Alexey Vazhnov

unread,
Sep 7, 2016, 7:02:32 AM9/7/16
to Ansible Project
What do you see when start ec2.py just as python application?
If you see your instances, may be you need to use:
inventory = /etc/ansible/inventory/

chall...@gmail.com

unread,
Sep 9, 2016, 11:04:32 AM9/9/16
to Ansible Project
Thanks you so much for your help the issue has been resolved.

Brian Coca

unread,
Sep 13, 2016, 7:09:33 PM9/13/16
to ansible...@googlegroups.com
run the script /etc/ansible/inventory/ec2.py directly and see what output you get.



----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages