Currently there is the need to manually create a VPC and write down the necessary IDs. This can be automated - and that is what the commit does. There are now tasks to automatically provision and tear down the VPC.
The main motivation for this change are:
We should not do manual work when it can be automated and
We should not expect users to know their way around AWS, and thus configuring a VPC might scare them away (it scared me!). Also,
I want to better understand the provisioners to add more later on - cleaning up and improving them was a good start I think.
The changes in detail:
The README does not mention the VPCs any more
The provision section of the manage-ec2 role now has two blocks: one automatically generating a vpc if it is not previously defined, and one block to work just like it used to when a vpc is configured manually
To make this possible, the teardown and the provision functions are copied to separate sub-playbooks - this makes it much more readable and maintainable
Also, some defaults are removed or where necessary moved to the plays itself - that way we no longer have hard coded VPCs as default (!) in the roles anymore.
During this work, some only roughly connected things change as well:
All instances are now written with detailed ec2 tags - that way everyone can quickly check who provisioned an instance, and everyone can quickly see that this is indeed a lightbulb instance.
The version requirement is not in the README anymore, but there is a task checking for the right version and providing a proper error message if needed.
Also, two minor code tweaks were done to avoid deprecated Ansible functions: pipe filter and static includes.
A lot of this code was taken over from linklight, thanks for the work there!
Currently there is the need to manually create a VPC and write down the necessary IDs. This can be automated - and that is what the commit does. There are now tasks to automatically provision and tear down the VPC.
The main motivation for this change are:
The changes in detail:
During this work, some only roughly connected things change as well:
A lot of this code was taken over from linklight, thanks for the work there!