title: Having trouble provisioning EC2 instances using Ansible
body: <p>I'm very confused on how you are supposed to launch EC2 instances using Ansible.</p>
  
  <p>I'm trying to use the ec2.py inventory scripts. I'm not sure which one is supposed to be used, because there is three installed with Ansible:</p>
  
  <ul>
  <li>ansible/lib/ansible/module_utils/ec2.py</li>
  <li>ansible/lib/ansible/modules/core/cloud/amazon/ec2.py</li>
  <li>ansible/plugins/inventory/ec2.py</li>
  </ul>
  
  <p>I thought running the one in inventory/ would make most sense, so I run it using:</p>
  
  <pre><code>ansible-playbook launch-ec2.yaml -i ec2.py
  </code></pre>
  
  <p>which gives me:</p>
  
  <pre><code>msg: Either region or ec2_url must be specified
  </code></pre>
  
  <p>So I add a region (even though I have a vpc_subnet_id specified) and I get:</p>
  
  <pre><code>msg: Region us-east-1e does not seem to be available for aws module boto.ec2. If the region definitely exists, you may need to upgrade boto or extend with endpoints_path
  </code></pre>
  
  <p>I'm thinking Amazon must have recently changed ec2 so you need to use a VPC? Even when I try and launch an instance from Amazon's console, the option for "EC2 Classic" is disabled.</p>
  
  <p>When I try and use the ec2.py script in cloud/amazon/ I get:</p>
  
  <pre><code>ERROR: Inventory script (/software/ansible/lib/ansible/modules/core/cloud/amazon/ec2.py) had an execution error:
  </code></pre>
  
  <p>There are no more details than this.</p>
  
  <p>After some searching, I see that ec2.py module in /module_utils <a href="https://github.com/ansible/ansible/pull/10734/files" rel="noreferrer" title="has been changed">has been changed</a> so a region doesn't need to be specified. I try to run this file but get:</p>
  
  <p>ERROR: The file /software/ansible/lib/ansible/module_utils/ec2.py is marked as executable, but failed to execute correctly. If this is not supposed to be an executable script, correct this with <code>chmod -x /software/ansible/lib/ansible/module_utils/ec2.py</code>.</p>
  
  <p>So as the error suggests, I remove the executable permissions for the ec2.py file, but then get the following error:</p>
  
  <pre><code>ERROR: /software/ansible/lib/ansible/module_utils/ec2.py:30: Invalid ini entry: distutils.version - need more than 1 value to unpack
  </code></pre>
  
  <p>Does anyone have any ideas on how to get this working? What is the correct file to be using? I'm completely lost at this point on how to get this working.</p>