All,
I've recently begun using the ec2.py dynamic inventory script and I've
thought of some relatively simple optional enhancements that would be
driven by the ec2.ini configuration file and wanted to see if there
was any interest in having them included.
I'd rather not maintain a company specific fork and I think these
features are generic enough to be useful to others. And since they
would be optional and only take effect if explicitly configured then
they won't impact folks that don't want them.
1) All of the built-in ec2_* facts are lowercase, but because some of
the keys are dynamic from user data in EC2 they can be a mish-mash of
cases. I propose a config setting that would allow them to be either
coerced into the same case or allow aliases (eg, have ec2_tag_Name and
ec2_tag_name point to identical lists).
2) Allow host aliases from other fields. I'm using EC2 inside of VPCs
and the private_ip_address makes sense as the destination_variable and
unique host name. But having a bunch of 10.0.0.* IPs flash across the
screen as tasks are executed isn't ideal since I don't memorize them.
It would be nice to be able to have something like "destination_alias"
(and vpc_destination_alias) that would let me pick some other field
like ec2_tag_Name or ec2_tag_ShortName, etc. This would also make it
easier to target a specific host from the command line with "-l app1"
instead of "-l 10.0.0.123" after having to look up the private IP from
AWS.
3) Group aliases. I'm using a VPC for each environment for production,
staging, etc but local development takes place on local virtual
machines (using vagrant). If my hosts criteria becomes
"ec2_tag_role_web" instead of just "web" then it makes it harder to
manage environments that aren't in EC2. So being able to have a way to
create an alias for a group would be nice. I'm not totally sure of the
right way to present this as configuration so that it's dynamic, but
if there's interest I can come up with a couple of ideas and see what
people think.
Anyways, thanks for reading this far.