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

Lines removed: over 500. Readiblity gained: A shitload Now you can actually get an overview of a manifest on a single screen height. I am sure that it will also save a lot of hassle when modifying schema in the future. No more "expected property name" etc. because of an extraneous comma Comments are of course natively support, so there's no need for this minify_json hokey pokey
31 lines
936 B
Python
31 lines
936 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
|
|
import bootstrapvz.providers.ec2.tasks.initd as initd_ec2
|
|
from bootstrapvz.common.tasks import initd
|
|
from bootstrapvz.common.tasks import ssh
|
|
|
|
if manifest.system['release'] in ['wheezy', 'stable']:
|
|
taskset.add(tasks.AddBackports)
|
|
|
|
taskset.update([tasks.SetMetadataSource,
|
|
tasks.AddCloudInitPackages,
|
|
])
|
|
|
|
options = manifest.plugins['cloud_init']
|
|
if 'username' in options:
|
|
taskset.add(tasks.SetUsername)
|
|
if 'disable_modules' in options:
|
|
taskset.add(tasks.DisableModules)
|
|
|
|
taskset.discard(initd_ec2.AddEC2InitScripts)
|
|
taskset.discard(initd.AddExpandRoot)
|
|
taskset.discard(initd.AdjustExpandRootScript)
|
|
taskset.discard(ssh.AddSSHKeyGeneration)
|