AWS provisioning with empty inventory

428 views
Skip to first unread message

Rodolfo Pilas

unread,
Jul 23, 2015, 1:13:38 PM7/23/15
to ansible...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


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

# ./playbooks/inventory/ec2.py --list
{
"_meta": {
"hostvars": {}
}
}

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
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
gpg: 2048R/23B5BE7B FCE6 6FC5 849D A0F6 E30D D1FC A33C 4E64 23B5 BE7B
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEVAwUBVbEgHqM8TmQjtb57AQi38QgAm5YvsmYh8KNoWUoj66uNaITYZgBJ/Uyv
yCmBO47IYOA42/CtEZBgV216C79jkNl+N7tqy/IooSyScCZs+ypTHqgHKrZSDirE
PGRJ6VaeNDPalc3zbVgf5AdwywUbumbYdLp6zlQFBb/uogZ0SvZ/QGZMD+Y+kgy8
zE8FxATaaNx7Mys/BY+iltIAl+D5zTewEUuMSrDJUJdvgy+ORO2VttiwWousnFEC
Cdt8jWvIPWm4ab+Q/WV2moPBW02kfLaPEMPdrQaF0/NwdF7Ys0tqyob13ghtBKwW
sR4PhTiawjsXOjm4wa2kGtDosCJWgwrAQ1b+uA7T5YUQD5FoEgn1Xg==
=NFdS
-----END PGP SIGNATURE-----

Scott Sturdivant

unread,
Jul 23, 2015, 1:39:01 PM7/23/15
to ansible...@googlegroups.com
What version of ansible?  This implies that it was fixed:  https://github.com/ansible/ansible/issues/9712 though possibly in a later version than what you're executing.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/55B1201E.3090002%40pilas.guru.
For more options, visit https://groups.google.com/d/optout.

Rodolfo Pilas

unread,
Jul 23, 2015, 1:59:51 PM7/23/15
to ansible...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256



El 23/7/15 a las 14:38, Scott Sturdivant escribió:
> What version of ansible? This implies that it was fixed:
> https://github.com/ansible/ansible/issues/9712 though possibly in
> a later version than what you're executing.

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
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
gpg: 2048R/23B5BE7B FCE6 6FC5 849D A0F6 E30D D1FC A33C 4E64 23B5 BE7B
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEVAwUBVbErjaM8TmQjtb57AQhvtAf/e6CfMCZvNNClzsQA+HNENC0Q8aWILd+8
SHDJ/Jst+4t5tvuxzHnq9pzE1UzTKU++QOIeIsHVhx2bIDIWwzgFaBvXN0HbMmjQ
8bGK2oa3/Xb04xG4Uhs2CPo319w73EHIga0G9BphSukMQjT2RJ84+EfdLIOWPbqn
u5CSeKug99a+YdAE7366xnH2mmKddsLiy0keVdLEXbuhd42ACHttbcGi9sVvxyIY
jASwH5KQmlgLHGdseyniw+/zvLMJ8rB1Hr+lJiyDlgnB2MlHKXEAqant3pwswx6V
yhahXYPeIhDdELgaRCi5CqvGJpz+jJIS7vQQV59FqkvL2E2maKA9Mw==
=gbNu
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages