# hacking ec2.py inventory script for localhost support

**URL:** <https://forum.ansible.com/t/hacking-ec2-py-inventory-script-for-localhost-support/12175>\
**Category:** Ansible Project\
**Created:** [December 31, 2012, 4:41pm UTC](https://forum.ansible.com/t/hacking-ec2-py-inventory-script-for-localhost-support/12175 "2012-12-31T16:41:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Martin](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@James\_Martin](https://forum.ansible.com/u/James_Martin)\
**Post date:** [December 31, 2012, 4:41pm UTC](https://forum.ansible.com/t/hacking-ec2-py-inventory-script-for-localhost-support/12175/1 "2012-12-31T16:41:31Z")

</div>

So I started hacking the ec2.py inventory script to add “localhost” as one of the groups … I had to do this because one of the playbooks I run references both localhost and some ec2 stuff.

Anyhow, I was also trying to set the ansible\_python\_interpreter from there, but it doesn’t get picked up during the playbook run. It does get picked up if I specify the variable directly in the playbook.

Any thoughts as to why it’s not working? snipped below:

[https://gist.github.com/4421106](https://gist.github.com/4421106)

Thanks,

James
