mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00

If all you want is to test an image or product and to achieve this you need to generate several images a day, you will end up with lots of AMI's and snapshots that have no use in the end of the day. This commit adds the new boolean manifest option "deregister_ami" that, if True, deletes the recently created AMI and snapshot. So, the final result will be only the running instance, nothing else.
13 lines
513 B
Python
13 lines
513 B
Python
def validate_manifest(data, validator, error):
|
|
import os.path
|
|
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
|
|
validator(data, schema_path)
|
|
|
|
|
|
def resolve_tasks(taskset, manifest):
|
|
import tasks
|
|
taskset.add(tasks.LaunchEC2Instance)
|
|
if 'print_public_ip' in manifest.plugins['ec2_launch']:
|
|
taskset.add(tasks.PrintPublicIPAddress)
|
|
if manifest.plugins['ec2_launch'].get('deregister_ami', False):
|
|
taskset.add(tasks.DeregisterAMI)
|