2013-12-01 12:26:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
def validate_manifest(data, schema_validate):
|
|
|
|
from os import path
|
|
|
|
schema_path = path.normpath(path.join(path.dirname(__file__), 'manifest-schema.json'))
|
|
|
|
schema_validate(data, schema_path)
|
|
|
|
|
|
|
|
|
2013-12-02 00:00:59 +01:00
|
|
|
def resolve_tasks(tasklist, manifest):
|
2013-12-29 17:45:23 +01:00
|
|
|
import tasks
|
|
|
|
import providers.ec2.tasks.initd as initd_ec2
|
2013-12-01 12:26:09 +01:00
|
|
|
from common.tasks import initd
|
2013-12-25 12:47:17 +00:00
|
|
|
|
2013-12-29 17:45:23 +01:00
|
|
|
if manifest.system['release'] in ['wheezy', 'stable']:
|
|
|
|
tasklist.add(tasks.AddBackports)
|
|
|
|
|
|
|
|
tasklist.add(tasks.AddCloudInitPackages,
|
|
|
|
tasks.SetMetadataSource)
|
|
|
|
|
2013-12-25 12:47:17 +00:00
|
|
|
options = manifest.plugins['cloud_init']
|
|
|
|
if 'username' in options:
|
2013-12-29 17:45:23 +01:00
|
|
|
tasklist.add(tasks.SetUsername)
|
2013-12-25 12:47:17 +00:00
|
|
|
if 'disable_modules' in options:
|
2013-12-29 17:45:23 +01:00
|
|
|
tasklist.add(tasks.DisableModules)
|
2013-12-25 12:47:17 +00:00
|
|
|
|
2013-12-29 17:45:23 +01:00
|
|
|
tasklist.remove(initd_ec2.AddEC2InitScripts,
|
2013-12-01 12:26:09 +01:00
|
|
|
initd.AddExpandRoot,
|
|
|
|
initd.AdjustExpandRootScript,
|
|
|
|
initd.AddSSHKeyGeneration)
|