# AWS provisioning with empty inventory

**URL:** <https://forum.ansible.com/t/aws-provisioning-with-empty-inventory/18834>\
**Category:** Ansible Project\
**Tags:** ubuntu, aws\
**Created:** [July 23, 2015, 5:10pm UTC](https://forum.ansible.com/t/aws-provisioning-with-empty-inventory/18834 "2015-07-23T17:10:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rodolfo\_Pilas](https://avatars.discourse-cdn.com/v4/letter/r/13edae/32.png) [@Rodolfo\_Pilas](https://forum.ansible.com/u/Rodolfo_Pilas)\
**Post date:** [July 23, 2015, 5:10pm UTC](https://forum.ansible.com/t/aws-provisioning-with-empty-inventory/18834/1 "2015-07-23T17:10:54Z")

</div>

I have problems to provision AWS when I have not at last one instance  
online like this:

# ./playbooks/inventory/ec2.py --list  
{  
&nbsp;&nbsp;"\_meta": {  
&nbsp;&nbsp;&nbsp;&nbsp;"hostvars": {}  
&nbsp;&nbsp;}  
}

and when I try to run ansible-playbook I receive

ERROR: provided hosts list is empty

If I go to AWS Console and lounch just one instance, the  
ansible-playbook runs without problem and it provision all the other  
required instances.

I have followed this tutorial:  
[http://docs.ansible.com/ansible/guide\_aws.html](http://docs.ansible.com/ansible/guide_aws.html)  
and also the chapter of Amazon EC2 of Lorin Hochstein book.

I also set these environment variables:  
export AWS\_ACCESS\_KEY\_ID='AKI...5YDA'  
export AWS\_SECRET\_ACCESS\_KEY='ndqL.....UT0st6'  
export ANSIBLE\_CONFIG=/etc/ansible/ansible.cfg  
export ANSIBLE\_HOSTS=/etc/ansible/playbooks/inventory/ec2.py  
export EC2\_INI\_PATH=/etc/ansible/playbooks/inventory/ec2.ini

I also tryed with a hosts file like this:  
[defaults]  
remote\_user = ubuntu  
hostfile = ./playbooks/inventory/ec2.py  
host\_key\_checking = False

[ssh\_connection]  
pipelining = True

but ansible refuses to start provisioning with an empty EC2 inventory.

Can you please explain me how solve the ERROR ?

Regards,

- --  
Rodolfo Pilas  
@pilasguru  
[http://pilas.guru](http://pilas.guru)  
gpg: 2048R/23B5BE7B FCE6 6FC5 849D A0F6 E30D D1FC A33C 4E64 23B5 BE7B

---

<div class="post-metadata">

**Author:** ![Scott\_Sturdivant](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Scott\_Sturdivant](https://forum.ansible.com/u/Scott_Sturdivant)\
**Post date:** [July 23, 2015, 5:38pm UTC](https://forum.ansible.com/t/aws-provisioning-with-empty-inventory/18834/2 "2015-07-23T17:38:47Z")

</div>

What version of ansible? This implies that it was fixed: [https://github.com/ansible/ansible/issues/9712](https://github.com/ansible/ansible/issues/9712) though possibly in a later version than what you’re executing.

---

<div class="post-metadata">

**Author:** ![Rodolfo\_Pilas1](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@Rodolfo\_Pilas1](https://forum.ansible.com/u/Rodolfo_Pilas1)\
**Post date:** [July 23, 2015, 5:59pm UTC](https://forum.ansible.com/t/aws-provisioning-with-empty-inventory/18834/3 "2015-07-23T17:59:41Z")

</div>

Thank you Scott, this was the problem:

Previous version:

~# ansible --version  
ansible 1.7.2

Upgraded and working like..... ansibleeeEE !

~# ansible --version  
ansible 2.0.0  
&nbsp;&nbsp;configured module search path = /usr/share/ansible

# ansible-playbook site.yml  
[WARNING]: provided hosts list is empty, only localhost is available

[DEPRECATION WARNING]: ec2\_ami\_search is kept for backwards  
compatibility but  
usage is discouraged. The module documentation details page may  
explain more  
about this rationale.. This feature will be removed in a future release.  
Deprecation warnings can be disabled by setting  
deprecation\_warnings=False in  
ansible.cfg.

[DEPRECATION WARNING]: ec2\_ami\_search is kept for backwards  
compatibility but  
usage is discouraged. The module documentation details page may  
explain more  
about this rationale.. This feature will be removed in a future release.  
Deprecation warnings can be disabled by setting  
deprecation\_warnings=False in  
ansible.cfg.

PLAY [Create .....

- --  
Rodolfo Pilas  
@pilasguru  
[http://pilas.guru](http://pilas.guru)  
gpg: 2048R/23B5BE7B FCE6 6FC5 849D A0F6 E30D D1FC A33C 4E64 23B5 BE7B
