EC2 modules refactor

There is an awful lot of common code in the EC2 modules that would make a lot more sense to provide through module_utils/ec2.py

At the moment, the list of AWS regions and the code that determines what region to log into is written on a per module basis. It would make a lot more sense to go into the common code (e.g. if Amazon added a new region tomorrow, then we’d need to change 10+ modules rather than just one common library). Doing this might not make sense for every module that uses AWS but would for most of the ec2* modules.

Just wanted to check before I go ahead and make this change that noone was working on it already and that it would be a desirable change.

Will

Hi Will,

( For those that don’t know, we have a mechanism for sharing common code between modules: https://github.com/ansible/ansible/tree/devel/lib/ansible/module_utils )

I’m all for moving more common ec2 things into this, just make sure to take time to test all affected modules and note anything that you didn’t get to.

That would be great, thanks!