glenjarvis/ansible_aws_playbooks — pull request #2 by glenjarvis (2014-01-02 03:00:27+00:00)
Title: Add EC2 Dynamic Host generation

Instead of a static Ansible host configuration, one can also have a dynamic one generated via EC2. The original author of this EC2 dynamic inventory generated script is added.

At this point, one should be able to issue the following to get a JSON list (in ansible format) of the list in EC2:

./ansible_hosts --list

Note, that this still requires environment variables to be set so that AWS can be accessed. The script (not to be checked in) that configures my environment is similar to the following:

export ANSIBLE_HOSTS=./ansible_hosts
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export PATH=$HOME/.../virtualenv/bin:$PATH