# trouble with ec2 inventory script

**URL:** <https://forum.ansible.com/t/trouble-with-ec2-inventory-script/12090>\
**Category:** Ansible Project\
**Created:** [November 16, 2012, 4:01am UTC](https://forum.ansible.com/t/trouble-with-ec2-inventory-script/12090 "2012-11-16T04:01:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rodney\_Quillo](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@Rodney\_Quillo](https://forum.ansible.com/u/Rodney_Quillo)\
**Post date:** [November 16, 2012, 4:01am UTC](https://forum.ansible.com/t/trouble-with-ec2-inventory-script/12090/1 "2012-11-16T04:01:38Z")

</div>

This post might also help:

[http://www.capsunlock.net/2012/10/using-ansible-for-ec2.html](http://www.capsunlock.net/2012/10/using-ansible-for-ec2.html)

Let us know how it goes.

---

<div class="post-metadata">

**Author:** ![nflacco](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@nflacco](https://forum.ansible.com/u/nflacco)\
**Post date:** [November 16, 2012, 6:55am UTC](https://forum.ansible.com/t/trouble-with-ec2-inventory-script/12090/2 "2012-11-16T06:55:06Z")

</div>

Thanks for the replies! Right now I think I can get away with the single key use case as I’m not managing that many instances/security groups.

One more question- I’m having trouble running any commands/modules on a server (I get failed to transfer file). If it makes a difference using ssh instead of sftp- I have sftp, but maybe OSX is interfering with paramiko accessing it.

> ansible prod-servers --user=ec2-user --private-key=key.pem -c ssh -m yum -a “pkg=acme state=installed”

and that command returns

> [www.myserver.com](http://www.myserver.com) | FAILED =\> failed to transfer file to /home/ec2-user/.ansible/tmp/ansible-1353048600.42-120901038647992/yum:  
> Connecting to [www.myserver.com](http://www.myserver.com)…  
> // MOTD //  
> subsystem request failed on channel 0  
> Connection closed

I looked briefly at adding a private key option into the hosts file as Michael suggested and it doesn’t seem like it would be too hard, so if I have some time I’ll do that.

---

<div class="post-metadata">

**Author:** ![Rodney\_Quillo](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@Rodney\_Quillo](https://forum.ansible.com/u/Rodney_Quillo)\
**Post date:** [November 16, 2012, 7:25am UTC](https://forum.ansible.com/t/trouble-with-ec2-inventory-script/12090/3 "2012-11-16T07:25:05Z")

</div>

Might be related to this issue: [https://github.com/ansible/ansible/issues/1279](https://github.com/ansible/ansible/issues/1279)  
There's a newer option to use scp than sftp in current devel for ssh  
transport.

-Rodney

---

<div class="post-metadata">

**Author:** ![nflacco](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@nflacco](https://forum.ansible.com/u/nflacco)\
**Post date:** [November 17, 2012, 12:26am UTC](https://forum.ansible.com/t/trouble-with-ec2-inventory-script/12090/4 "2012-11-17T00:26:44Z")

</div>

Hmm, maybe. I tried doing this (parmiko, ssh and playbooks with both options) in OSX and LinuxMint and got problems. I posted a new message on this as you guys answered the main thrust of my initial question.
