Ansible and EC2
The last several months have been a deep dive into Ansible. Deterministic. Simplistic. Ideally push based. Uses standard YAML. (I’ve never been much for inventing your own language.) Most of this work has been with Amazon’s EC2 service and Ansible’s included dynamic inventory plugin for EC2 has been indispensable.
However, there’s a lot more this inventory plugin could do. I’ve developed a series of patches, some of which I’ve submitted pull requests for. All of which can be had by cloning the master branch of my GitHub Ansible fork.
- Do you have more than one AWS account? Need to manage machines in
all of them? The
multipleaawsaaccounts
branch teaches
ec2.py
to query multiple accounts given the proper IAM credentials. - Making groups from various tags and attributes in AWS is handy. But
I wanted a way to just make arbitrary groups happen. The
arbitraryggroups
branch supports reading groups from the
ansible_groups
AWS tag on your EC2 instances. - Need additional information about the EBS stores mapped to your
instnaces? The
blockddevicemmapping
branch exposes this as inventory variables from
ec2.py
.