[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-10-07 Thread 'Nirav Radia' via Ansible Project
I could not find the real reason why the SSH on EC2 instance running CentOS was not able to connect. The workaround I applied was to write a module which try to connect host over SSH for given number of times and return success when it is successful so that further plays won't fail because of u

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-26 Thread 'Nirav Radia' via Ansible Project
Hi, While browsing the integration tests of Ansible modules, I cam across this: https://github.com/ansible/ansible/blob/7f8e8ddca9cf103c05bf39d68ebb2e2ded4067f2/test/utils/ansible-playbook_integration_runner/ec2.yml It has a task named "Wait a little longer for centos". So anyone know why is it

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-26 Thread 'Nirav Radia' via Ansible Project
Hi Alex / everyone, Another finding: * This also works fine: wait_for: host={{ item.public_dns_name }} port=22 delay=60 timeout=320 state =started I want to understand why wait_for: host={{ item.public_dns_name }} port=22 does not work when I query for a particular region? Does it return befo

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-25 Thread 'Nirav Radia' via Ansible Project
Hi Alex Sorry for late reply. I am using Ansible 2.1.1.0. It happens for any available region over AWS. One more finding: * If I remove port in wait_for, it works ok. On Friday, 23 September 2016 05:55:28 UTC+5:30, Alexander H. Laughlin wrote: > > Hi Nirav, > > This is a tough nut to crack. W

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-22 Thread Alexander H. Laughlin
Hi Nirav, This is a tough nut to crack. Which version of Ansible are you using? Which region is it specifically that is failing? Or is it just any region that is specified over 'any' region? Alex On Thursday, September 22, 2016 at 3:43:38 AM UTC-7, Nirav Radia wrote: > > Hi Alex, > > Replacing

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-22 Thread 'Nirav Radia' via Ansible Project
Hi Alex, Replacing availability zone in ec2.ini also gave me the same error: ERROR! The file inventory/ec2.py is marked as executable, but failed to execute correctly. If this is not supposed to be an executable script, correct this with `chmod -x inventory/ec2.py`. Inventory script (inventory/

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-22 Thread Alexander H. Laughlin
Hi Nirav, Sorry about the lack of clarity in my suggestion. I was referring to your ec2.ini, specifically: # AWS regions to make calls to. Set this to 'all' to make request to all regions # in AWS and merge the results together. Alternatively, set this to a comma # separated list of regions. E

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-22 Thread 'Nirav Radia' via Ansible Project
Hi Alex, 1) I am not sure I understood "placing the availability zone in the region field instead of the region" correctly. Because when I exported "us-west-2a" as AWS_DEFAULT_REGION (which my ec2.py is using to filter region), it gave me error like this: ERROR! The file inventory/ec2.py is ma

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-21 Thread Alexander H. Laughlin
Hi Nirav, I have a vague recollection of at some point having had a similar issue with dynamic inventory that was solved by placing the availability zone in the region field instead of the region. My memory is far from a reliable source of information so if you decide to give that a shot don't

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-21 Thread 'Nirav Radia' via Ansible Project
Thanks @Alexander for your reply. Here is *ec2.ini* # Ansible EC2 external inventory script settings # [ec2] # to talk to a private eucalyptus instance uncomment these lines # and edit edit eucalyptus_host to be the host name of your cloud controller #eucalyptus = True #eucalyptus_host = clc.

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-19 Thread Alexander H. Laughlin
Would you mind to post your ec2.ini with the credentials taken out? Also, what is the output of ec2.py when you run it alone? On Friday, September 16, 2016 at 12:15:39 AM UTC-7, Nirav Radia wrote: > > Hi all, > > I am pretty new to Ansible. I am using ec2.py to connect to my EC2 > instances and