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