Convert every JSON file to YAML

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
This commit is contained in:
Anders Ingemann 2014-07-05 20:01:20 +02:00
parent ebba39f59b
commit 03a0746299
123 changed files with 1518 additions and 1987 deletions

View file

@ -12,7 +12,7 @@ def validate_manifest(data, validator, error):
:param function error: The function tha raises an error when the validation fails
"""
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)
# Check the bootloader/partitioning configuration.

View file

@ -33,7 +33,7 @@ class BootstrapInformation(object):
# Normalize the release codenames so that tasks may query for release codenames rather than
# 'stable', 'unstable' etc. This is useful when handling cases that are specific to a release.
release_codenames_path = os.path.join(os.path.dirname(__file__), 'release-codenames.json')
release_codenames_path = os.path.join(os.path.dirname(__file__), 'release-codenames.yml')
from bootstrapvz.common.tools import config_get
self.release_codename = config_get(release_codenames_path, [self.manifest.system['release']])

View file

@ -1,214 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Generic manifest",
"type": "object",
"properties": {
"provider": {
"type": "object",
"properties": {
"name": { "type": "string" }
},
"required": ["name"]
},
"bootstrapper": {
"type": "object",
"properties": {
"workspace": { "$ref": "#/definitions/path" },
"mirror": { "type": "string", "format": "uri" },
"tarball": { "type": "boolean" },
"include_packages": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[^/]+$"
},
"minItems": 1
},
"exclude_packages": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[^/]+$"
},
"minItems": 1
}
},
"required": ["workspace"]
},
"image": {
"type": "object",
"properties": {
"name": { "type": "string" }
},
"required": ["name"]
},
"system": {
"type": "object",
"properties": {
"release": {
"enum": [
"squeeze", "wheezy", "jessie", "sid",
"oldstable", "stable", "testing", "unstable"
]
},
"architecture": { "enum": ["i386", "amd64"] },
"bootloader": { "enum": ["pvgrub", "grub", "extlinux"] },
"timezone": { "type": "string" },
"locale": { "type": "string" },
"charmap": { "type": "string" },
"hostname": {
"type": "string",
"pattern": "^\\S+$"
}
},
"required": ["release", "architecture", "bootloader", "timezone", "locale", "charmap"]
},
"packages": {
"type": "object",
"properties": {
"mirror": { "type": "string", "format": "uri" },
"sources": {
"type": "object",
"patternProperties": {
"^[^\/\\0]+$": {
"type": "array",
"items": {
"type": "string",
"pattern": "^(deb|deb-src)\\s+(\\[\\s*(.+\\S)?\\s*\\]\\s+)?\\S+\\s+\\S+(\\s+(.+\\S))?\\s*$"
},
"minItems": 1
}
},
"additionalProperties": false,
"minItems": 1
},
"components": {
"type": "array",
"items": {"type": "string"},
"minItems": 1
},
"preferences": {
"type": "object",
"patternProperties": {
"^[^\/\\0]+$": {
"type": "array",
"items": {
"type": "object",
"properties": {
"pin": {
"type": "string"
},
"package": {
"type": "string"
},
"pin-priority": {
"type": "integer"
}
},
"required": ["pin", "package", "pin-priority"],
"additionalProperties": false
},
"minItems": 1
}
},
"additionalProperties": false,
"minItems": 1
},
"trusted-keys": {
"type": "array",
"items": { "$ref": "#/definitions/absolute_path" },
"minItems": 1
},
"install": {
"type": "array",
"items": {
"anyOf": [
{ "pattern": "^[^/]+(/[^/]+)?$" },
{ "$ref": "#/definitions/absolute_path" }
]
},
"minItems": 1
},
"install_standard": {
"type": "boolean"
}
},
"additionalProperties": false
},
"volume": {
"type": "object",
"properties": {
"backing": { "type": "string" },
"partitions": {
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/no_partitions" },
{ "$ref": "#/definitions/partition_table" }
]
}
},
"required": ["partitions"]
},
"plugins": {
"type": "object",
"patternProperties": {
"^\\w+$": {
"type": "object"
}
},
"additionalProperties": false
}
},
"required": ["provider", "bootstrapper", "system", "volume"],
"definitions": {
"path": {
"type": "string",
"pattern": "^[^\\0]+$"
},
"absolute_path": {
"type": "string",
"pattern": "^/[^\\0]+$"
},
"bytes": {
"type": "string",
"pattern": "^\\d+([KMGT]i?B|B)$"
},
"no_partitions": {
"type": "object",
"properties": {
"type": { "enum": ["none"] },
"root": { "$ref": "#/definitions/partition" }
},
"required": ["root"],
"additionalProperties": false
},
"partition_table": {
"type": "object",
"properties": {
"type": { "enum": ["msdos", "gpt"] },
"boot": { "$ref": "#/definitions/partition" },
"root": { "$ref": "#/definitions/partition" },
"swap": {
"type": "object",
"properties": { "size": { "$ref": "#/definitions/bytes" } },
"required": ["size"]
}
},
"required": ["root"],
"additionalProperties": false
},
"partition": {
"type": "object",
"properties": {
"size": { "$ref": "#/definitions/bytes" },
"filesystem": { "enum": ["ext2", "ext3", "ext4", "xfs"] },
"format_command": {
"type": "array",
"items": {"type": "string"},
"minItems": 1
}
},
"required": ["size", "filesystem"]
}
}
}

View file

@ -0,0 +1,177 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: Generic manifest
type: object
required: [provider, bootstrapper, system, volume]
properties:
provider:
type: object
properties:
name: {type: string}
required: [name]
bootstrapper:
type: object
properties:
exclude_packages:
type: array
items:
type: string
pattern: '^[^/]+$'
minItems: 1
include_packages:
type: array
items:
type: string
pattern: '^[^/]+$'
minItems: 1
mirror:
type: string
format: uri
tarball: {type: boolean}
workspace:
$ref: '#/definitions/path'
required: [workspace]
image:
type: object
properties:
name: {type: string}
required: [name]
system:
properties:
architecture:
enum: [i386, amd64]
bootloader:
enum:
- pvgrub
- grub
- extlinux
charmap: {type: string}
hostname:
type: string
pattern: ^\S+$
locale: {type: string}
release:
enum:
- squeeze
- wheezy
- jessie
- sid
- oldstable
- stable
- testing
- unstable
timezone: {type: string}
required:
- release
- architecture
- bootloader
- timezone
- locale
- charmap
type: object
packages:
type: object
properties:
components:
type: array
items: {type: string}
minItems: 1
install:
type: array
items:
anyOf:
- pattern: ^[^/]+(/[^/]+)?$
- $ref: '#/definitions/absolute_path'
minItems: 1
install_standard: {type: boolean}
mirror:
type: string
format: uri
preferences:
type: object
patternProperties:
^[^/\0]+$:
type: array
items:
type: object
properties:
package: {type: string}
pin: {type: string}
pin-priority: {type: integer}
required: [pin, package, pin-priority]
additionalProperties: false
minItems: 1
minItems: 1
additionalProperties: false
sources:
type: object
patternProperties:
^[^/\0]+$:
items:
type: string
pattern: ^(deb|deb-src)\s+(\[\s*(.+\S)?\s*\]\s+)?\S+\s+\S+(\s+(.+\S))?\s*$
minItems: 1
type: array
minItems: 1
additionalProperties: false
trusted-keys:
type: array
items:
$ref: '#/definitions/absolute_path'
minItems: 1
additionalProperties: false
plugins:
type: object
patternProperties:
^\w+$: {type: object}
volume:
type: object
properties:
backing: {type: string}
partitions:
type: object
oneOf:
- $ref: '#/definitions/no_partitions'
- $ref: '#/definitions/partition_table'
required: [partitions]
definitions:
absolute_path:
type: string
pattern: ^/[^\0]+$
bytes:
pattern: ^\d+([KMGT]i?B|B)$
type: string
no_partitions:
type: object
properties:
root: {$ref: '#/definitions/partition'}
type: {enum: [none]}
required: [root]
additionalProperties: false
partition:
type: object
properties:
filesystem:
enum: [ext2, ext3, ext4, xfs]
format_command:
items: {type: string}
minItems: 1
type: array
size: {$ref: '#/definitions/bytes'}
required: [size, filesystem]
partition_table:
type: object
additionalProperties: false
properties:
boot: {$ref: '#/definitions/partition'}
root: {$ref: '#/definitions/partition'}
swap:
type: object
properties:
size: {$ref: '#/definitions/bytes'}
required: [size]
type: {enum: [msdos, gpt]}
required: [root]
path:
type: string
pattern: ^[^\0]+$

View file

@ -2,8 +2,7 @@
to determine which tasks should be added to the tasklist, what arguments various
invocations should have etc..
"""
from bootstrapvz.common.tools import load_json
from bootstrapvz.common.tools import load_yaml
from bootstrapvz.common.tools import load_data
import logging
log = logging.getLogger(__name__)
@ -31,12 +30,7 @@ class Manifest(object):
Once they are loaded, the initialize() function is called on each of them (if it exists).
The provider must have an initialize function.
"""
# Load the manifest JSON using the loader in common.tools
# It strips comments (which are invalid in strict json) before loading the data.
if self.path.endswith('.json'):
self.data = load_json(self.path)
elif self.path.endswith('.yml') or self.path.endswith('.yaml'):
self.data = load_yaml(self.path)
self.data = load_data(self.path)
# Get the provider name from the manifest and load the corresponding module
provider_modname = 'bootstrapvz.providers.' + self.data['provider']['name']
@ -102,19 +96,20 @@ class Manifest(object):
:param str schema_path: Path to the json-schema to use for validation
"""
import jsonschema
schema = load_json(schema_path)
schema = load_data(schema_path)
try:
jsonschema.validate(data, schema)
except jsonschema.ValidationError as e:
self.validation_error(e.message, e.path)
def validation_error(self, message, json_path=None):
def validation_error(self, message, data_path=None):
"""This function is passed to all validation functions so that they may
raise a validation error because a custom validation of the manifest failed.
:param str message: Message to user about the error
:param list json_path: A path to the location in the manifest where the error occurred
:param list data_path: A path to the location in the manifest where the error occurred
:raises ManifestError: With absolute certainty
"""
from bootstrapvz.common.exceptions import ManifestError
raise ManifestError(message, self.path, json_path)
raise ManifestError(message, self.path, data_path)

View file

@ -1,22 +0,0 @@
{ // This is a mapping of Debian release names to their respective codenames
"unstable": "sid",
"testing": "jessie",
"stable": "wheezy",
"oldstable": "squeeze",
"jessie": "jessie",
"wheezy": "wheezy",
"squeeze": "squeeze",
// The following release names are not supported, but included of completeness sake
"lenny": "lenny",
"etch": "etch",
"sarge": "sarge",
"woody": "woody",
"potato": "potato",
"slink": "slink",
"hamm": "hamm",
"bo": "bo",
"rex": "rex",
"buzz": "buzz"
}

View file

@ -0,0 +1,23 @@
---
# This is a mapping of Debian release names to their respective codenames
unstable: sid
testing: jessie
stable: wheezy
oldstable: squeeze
jessie: jessie
wheezy: wheezy
squeeze: squeeze
# The following release names are not supported, but included fir completeness sake
lenny: lenny
etch: etch
sarge: sarge
woody: woody
potato: potato
slink: slink
hamm: hamm
bo: bo
rex: rex
buzz: buz

View file

@ -1,16 +1,16 @@
class ManifestError(Exception):
def __init__(self, message, manifest_path, json_path=None):
def __init__(self, message, manifest_path, data_path=None):
self.message = message
self.manifest_path = manifest_path
self.json_path = json_path
self.data_path = data_path
def __str__(self):
if self.json_path is not None:
path = '.'.join(map(str, self.json_path))
return ('{msg}\n File path: {file}\n JSON path: {jsonpath}'
.format(msg=self.message, file=self.manifest_path, jsonpath=path))
if self.data_path is not None:
path = '.'.join(map(str, self.data_path))
return ('{msg}\n File path: {file}\n Data path: {datapath}'
.format(msg=self.message, file=self.manifest_path, datapath=path))
return '{file}: {msg}'.format(msg=self.message, file=self.manifest_path)

View file

@ -1,14 +0,0 @@
// This is a mapping of Debian release codenames to NIC configurations
// Every item in an array is a line
{
"squeeze": ["auto lo",
"iface lo inet loopback",
"auto eth0",
"iface eth0 inet dhcp"],
"wheezy": ["auto eth0",
"iface eth0 inet dhcp"],
"jessie": ["auto eth0",
"iface eth0 inet dhcp"],
"sid": ["auto eth0",
"iface eth0 inet dhcp"]
}

View file

@ -0,0 +1,17 @@
---
# This is a mapping of Debian release codenames to NIC configurations
# Every item in an array is a line
squeeze:
- auto lo
- iface lo inet loopback
- auto eth0
- iface eth0 inet dhcp
wheezy:
- auto eth0
- iface eth0 inet dhcp
jessie:
- auto eth0
- iface eth0 inet dhcp
sid:
- auto eth0
- iface eth0 inet dhcp

View file

@ -45,7 +45,7 @@ class ConfigureNetworkIF(Task):
@classmethod
def run(cls, info):
network_config_path = os.path.join(os.path.dirname(__file__), 'network-configuration.json')
network_config_path = os.path.join(os.path.dirname(__file__), 'network-configuration.yml')
from ..tools import config_get
if_config = config_get(network_config_path, [info.release_codename])

View file

@ -1,3 +1,5 @@
def log_check_call(command, stdin=None, env=None, shell=False, cwd=None):
status, stdout, stderr = log_call(command, stdin, env, shell, cwd)
if status != 0:
@ -73,8 +75,21 @@ def load_yaml(path):
return yaml.safe_load(fobj)
def load_data(path):
import os.path
filename, extension = os.path.splitext(path)
if not os.path.isfile(path):
raise Exception('The path {path} does not point to a file.'.format(path=path))
if extension == '.json':
return load_json(path)
elif extension == '.yml' or extension == '.yaml':
return load_yaml(path)
else:
raise Exception('Unrecognized extension: {ext}'.format(ext=extension))
def config_get(path, config_path):
config = load_json(path)
config = load_data(path)
for key in config_path:
config = config.get(key)
return config

View file

@ -2,7 +2,7 @@
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,21 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Admin user plugin manifest",
"type": "object",
"properties": {
"plugins": {
"type": "object",
"properties": {
"admin_user": {
"type": "object",
"properties": {
"username": {
"type": "string"
}
},
"required": ["username"]
}
}
}
}
}

View file

@ -0,0 +1,13 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: Admin user plugin manifest
type: object
properties:
plugins:
type: object
properties:
admin_user:
type: object
properties:
username: {type: string}
required: [username]

View file

@ -1,6 +1,6 @@
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,27 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "APT proxy plugin manifest",
"type": "object",
"properties": {
"plugins": {
"type": "object",
"properties": {
"apt_proxy": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"persistent": {
"type": "boolean"
},
"port": {
"type": "integer"
}
},
"required": ["address", "port"]
}
}
}
}
}

View file

@ -0,0 +1,17 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: APT proxy plugin manifest
type: object
properties:
plugins:
type: object
properties:
apt_proxy:
type: object
properties:
address: {type: string}
port: {type: integer}
persistent: {type: boolean}
required:
- address
- port

View file

@ -3,7 +3,7 @@ import tasks
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,25 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Chef plugin manifest",
"type": "object",
"properties": {
"plugins": {
"type": "object",
"properties": {
"chef": {
"type": "object",
"properties": {
"assets": { "$ref": "#/definitions/absolute_path" }
},
"required": ["assets"]
}
}
}
},
"definitions": {
"absolute_path": {
"type": "string",
"pattern": "^/[^\\0]+$"
}
}
}

View file

@ -0,0 +1,19 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: Chef plugin manifest
type: object
properties:
plugins:
type: object
properties:
chef:
type: object
properties:
assets:
$ref: '#/definitions/absolute_path'
required:
- assets
definitions:
absolute_path:
pattern: ^/[^\0]+$
type: string

View file

@ -2,7 +2,7 @@
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,44 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "cloud-init plugin manifest",
"type": "object",
"properties": {
"system": {
"type": "object",
"properties": {
"release": {
"type": "string",
"enum": ["wheezy", "stable",
"jessie", "testing",
"sid", "unstable"]
}
}
},
"plugins": {
"type": "object",
"properties": {
"cloud_init": {
"type": "object",
"properties": {
"username": {
"type": "string"
},
"disable_modules": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"metadata_sources": {
"type": "string"
}
},
"required": ["username"]
},
"packages": {"type": "object"}
},
"required": ["cloud_init"]
}
}
}

View file

@ -0,0 +1,30 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: cloud-init plugin manifest
type: object
properties:
system:
type: object
properties:
release:
type: string
enum:
- wheezy
- stable
- jessie
- testing
- sid
- unstable
plugins:
type: object
properties:
cloud_init:
type: object
properties:
username: {type: string}
metadata_sources: {type: string}
disable_modules:
type: array
items: {type: string}
uniqueItems: true
required: [username]

View file

@ -1,14 +1,10 @@
import tasks
import os.path
from bootstrapvz.common.exceptions import ManifestError
def validate_manifest(data, validator, error):
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
try:
validator(data, schema_path)
except ManifestError, e:
error('docker_daemon manifest validation failed: "%s"' % e.message, e.json_path)
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)
if data.get('system', {}).get('release', None) in ['wheezy', 'stable']:
# prefs is a generator of apt preferences across files in the manifest
prefs = (item for vals in data.get('packages', {}).get('preferences', {}).values() for item in vals)

View file

@ -1,24 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Install Docker plugin manifest",
"type": "object",
"properties": {
"system": {
"type": "object",
"properties": {
"architecture": {
"type": "string",
"enum": ["amd64"]
// Docker runs on x86_64 only
},
"release": {
"not": {
"type": "string",
"enum": ["squeeze", "oldstable"]
// Docker needs at least wheezy + backports.
}
}
}
}
}
}

View file

@ -0,0 +1,17 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: Install Docker plugin manifest
type: object
properties:
system:
type: object
properties:
architecture:
type: string
enum: [amd64]
release:
not:
type: string
enum:
- squeeze
- oldstable

View file

@ -2,7 +2,7 @@
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,29 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Image commands plugin manifest",
"type": "object",
"properties": {
"plugins": {
"type": "object",
"properties": {
"image_commands": {
"type": "object",
"properties": {
"commands": {
"type": "array",
"items": {
"type": "array",
"items": {"type": "string"},
"minItems": 1
},
"minItems": 1
}
},
"required": ["commands"]
}
},
"required": ["image_commands"]
}
},
"required": ["plugins"]
}

View file

@ -0,0 +1,25 @@
---
$schema: http://json-schema.org/draft-04/schema#
properties:
plugins:
properties:
image_commands:
properties:
commands:
items:
items:
type: string
minItems: 1
type: array
minItems: 1
type: array
required:
- commands
type: object
required:
- image_commands
type: object
required:
- plugins
title: Image commands plugin manifest
type: object

View file

@ -3,7 +3,7 @@ import tasks
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.join(os.path.dirname(__file__), 'manifest-schema.json')
schema_path = os.path.join(os.path.dirname(__file__), 'manifest-schema.yml')
validator(data, schema_path)
if data['plugins']['minimize_size'].get('shrink', False) and data['volume']['backing'] != 'vmdk':
error('Can only shrink vmdk images', ['plugins', 'minimize_size', 'shrink'])

View file

@ -1,19 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Minimize size plugin manifest",
"type": "object",
"properties": {
"plugins": {
"type": "object",
"properties": {
"minimize_size": {
"type": "object",
"properties": {
"shrink": { "type": "boolean" },
"zerofree": { "type": "boolean" }
}
}
}
}
}
}

View file

@ -0,0 +1,15 @@
---
$schema: http://json-schema.org/draft-04/schema#
properties:
plugins:
properties:
minimize_size:
properties:
shrink:
type: boolean
zerofree:
type: boolean
type: object
type: object
title: Minimize size plugin manifest
type: object

View file

@ -1,6 +1,6 @@
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,22 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "NTP plugin manifest",
"type": "object",
"properties": {
"plugins": {
"type": "object",
"properties": {
"ntp": {
"type": "object",
"properties": {
"servers": {
"type": "array",
"items": {"type": "string"},
"minItems": 1
}
}
}
}
}
}
}

View file

@ -0,0 +1,15 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: NTP plugin manifest
type: object
properties:
plugins:
type: object
properties:
ntp:
type: object
properties:
servers:
type: array
items: {type: string}
minItems: 1

View file

@ -3,7 +3,7 @@ import tasks
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,30 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Pip install plugin manifest",
"type": "object",
"properties": {
"plugins": {
"type": "object",
"properties": {
"pip_install": {
"type": "object",
"properties": {
"packages": { "$ref": "#/definitions/packages" }
},
"minProperties": 1,
"additionalProperties": false
}
}
}
},
"definitions": {
"packages": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
}
}
}

View file

@ -0,0 +1,17 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: Pip install plugin manifest
type: object
properties:
plugins:
type: object
properties:
pip_install:
type: object
properties:
packages:
type: array
items:
type: string
minItems: 1
uniqueItems: true

View file

@ -15,7 +15,7 @@ from bootstrapvz.common.tasks import partitioning
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,34 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Prebootstrapped plugin manifest",
"type": "object",
"properties": {
"volume": {
"type": "object",
"properties": {
"backing": {
"type": "string",
"enum": ["raw", "ebs", "s3", "vdi", "vmdk"]
}
},
"required": ["backing"]
},
"plugins": {
"type": "object",
"properties": {
"prebootstrapped": {
"type": "object",
"properties": {
"snapshot": {
"type": "string"
},
"image": {
"type": "string"
}
}
}
}
}
},
"required": ["volume"]
}

View file

@ -0,0 +1,25 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: Prebootstrapped plugin manifest
type: object
properties:
volume:
type: object
properties:
backing:
type: string
enum:
- raw
- ebs
- s3
- vdi
- vmdk
required: [backing]
plugins:
type: object
properties:
prebootstrapped:
type: object
properties:
image: {type: string}
snapshot: {type: string}

View file

@ -3,7 +3,7 @@ import tasks
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,28 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Puppet plugin manifest",
"type": "object",
"properties": {
"plugins": {
"type": "object",
"properties": {
"puppet": {
"type": "object",
"properties": {
"manifest": { "$ref": "#/definitions/absolute_path" },
"assets": { "$ref": "#/definitions/absolute_path" },
"enable_agent": { "type": "boolean" }
},
"minProperties": 1,
"additionalProperties": false
}
}
}
},
"definitions": {
"absolute_path": {
"type": "string",
"pattern": "^/[^\\0]+$"
}
}
}

View file

@ -0,0 +1,20 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: Puppet plugin manifest
type: object
properties:
plugins:
properties:
type: object
puppet:
type: object
properties:
assets: {$ref: '#/definitions/absolute_path'}
enable_agent: {type: boolean}
manifest: {$ref: '#/definitions/absolute_path'}
minProperties: 1
additionalProperties: false
definitions:
absolute_path:
pattern: ^/[^\0]+$
type: string

View file

@ -2,7 +2,7 @@
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,21 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Root password plugin manifest",
"type": "object",
"properties": {
"plugins": {
"type": "object",
"properties": {
"root_password": {
"type": "object",
"properties": {
"password": {
"type": "string"
}
},
"required": ["password"]
}
}
}
}
}

View file

@ -0,0 +1,13 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: Root password plugin manifest
type: object
properties:
plugins:
type: object
properties:
root_password:
type: object
properties:
password: {type: string}
required: [password]

View file

@ -3,7 +3,7 @@ import tasks
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,28 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Saltstack plugin manifest",
"type": "object",
"properties": {
"plugins": {
"type": "object",
"properties": {
"salt": {
"type": "object",
"properties": {
"master": { "type": "string" },
"install_source": { "enum": ["stable", "daily", "git"] },
"version": { "type": "string" },
"grains": {
"type": "object",
"patternProperties": {
"^[^\/\\0]+$": { "type": "string" }
},
"minItems": 1
}
},
"required": ["install_source"]
}
}
}
}
}

View file

@ -0,0 +1,24 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: Saltstack plugin manifest
type: object
properties:
plugins:
type: object
properties:
salt:
type: object
properties:
grains:
type: object
patternProperties:
^[^/\0]+$: {type: string}
minItems: 1
install_source:
enum:
- stable
- daily
- git
master: {type: string}
version: {type: string}
required: [install_source]

View file

@ -2,7 +2,7 @@
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,29 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Unattended upgrades plugin manifest",
"type": "object",
"properties": {
"plugins": {
"type": "object",
"properties": {
"unattended_upgrades": {
"type": "object",
"properties": {
"update_interval": {
"type": "integer"
},
"download_interval": {
"type": "integer"
},
"upgrade_interval": {
"type": "integer"
}
},
"required": ["update_interval", "download_interval", "upgrade_interval"]
}
},
"required": ["unattended_upgrades"]
}
},
"required": ["plugins"]
}

View file

@ -0,0 +1,18 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: Unattended upgrades plugin manifest
type: object
properties:
plugins:
type: object
properties:
unattended_upgrades:
type: object
properties:
download_interval: {type: integer}
update_interval: {type: integer}
upgrade_interval: {type: integer}
required:
- update_interval
- download_interval
- upgrade_interval

View file

@ -3,7 +3,7 @@ import tasks
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,34 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Vagrant plugin manifest",
"type": "object",
"properties": {
"provider": {
"type": "string",
"enum": ["virtualbox"]
},
"system": {
"required": ["hostname"]
},
"volume": {
"type": "object",
"properties": {
"backing": {
"type": "string",
"enum": ["vmdk"]
// VirtualBox only supports vmdk or raw when importing via OVF:
// https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp?rev=51092#L636
}
},
"required": ["backing"]
},
"plugins": {
"type": "object",
"properties": {
"vagrant": {
"type": "object"
}
}
}
}
}

View file

@ -0,0 +1,24 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: Vagrant plugin manifest
type: object
properties:
provider:
type: object
properties:
name:
type: string
enum: [virtualbox]
system:
required: [hostname]
volume:
type: object
properties:
backing:
type: string
enum: [vmdk]
required: [backing]
plugins:
type: object
properties:
vagrant: {type: object}

View file

@ -13,7 +13,7 @@ def initialize():
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,50 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Azure manifest",
"type": "object",
"properties": {
"provider": {
"type": "object",
"properties": {
"waagent": {
"type": "object",
"properties": {
"conf": {
"type": "string"
},
"version": {
"type": "string"
}
},
"required": ["version"]
}
}
"required": ["waagent"]
},
"system": {
"type": "object",
"properties": {
"bootloader": {
"type": "string",
"enum": ["grub", "extlinux"]
}
},
},
"volume": {
"type": "object",
"properties": {
"backing": {
"type": "string",
"enum": ["raw"]
},
"partitions": {
"type": "object",
"properties": {
"type": { "enum": ["none", "msdos", "gpt"] }
}
}
},
"required": ["backing"]
}
}
}

View file

@ -0,0 +1,38 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: Azure manifest
type: object
properties:
provider:
type: object
properties:
waagent:
type: object
properties:
conf: {type: string}
version: {type: string}
required: [version]
required: [waagent]
system:
type: object
properties:
bootloader:
type: string
enum:
- grub
- extlinux
volume:
type: object
properties:
backing:
type: string
enum: [raw]
partitions:
type: object
properties:
type:
enum:
- none
- msdos
- gpt
required: [backing]

View file

@ -23,7 +23,7 @@ def initialize():
def validate_manifest(data, validator, error):
import os.path
validator(data, os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
validator(data, os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
from bootstrapvz.common.bytes import Bytes
if data['volume']['backing'] == 'ebs':
@ -35,7 +35,7 @@ def validate_manifest(data, validator, error):
msg = ('The volume size must be a multiple of 1GiB when using EBS backing')
error(msg, ['volume', 'partitions'])
else:
validator(data, os.path.join(os.path.dirname(__file__), 'manifest-schema-s3.json'))
validator(data, os.path.join(os.path.dirname(__file__), 'manifest-schema-s3.yml'))
bootloader = data['system']['bootloader']
virtualization = data['provider']['virtualization']

View file

@ -1,49 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "EC2 manifest for instance store AMIs",
"type": "object",
"properties": {
"provider": {
"type": "object",
"properties": {
"credentials": {
"type": "object",
"properties": {
"certificate": {
"type": "string"
},
"private-key": {
"type": "string"
},
"user-id": {
"type": "string",
"pattern": "(^arn:aws:iam::\\d*:user/\\w.*$)|(^\\d{4}-\\d{4}-\\d{4}$)"
}
}
}
}
},
"image": {
"type": "object",
"properties": {
"bucket": {
"type": "string"
},
"region": {
"$ref": "#/definitions/aws-region"
}
},
"required": ["bucket", "region"]
}
},
"required": ["image"],
"definitions": {
"aws-region": {
"enum": ["ap-northeast-1", "ap-southeast-1",
"ap-southeast-2", "eu-west-1",
"sa-east-1", "us-east-1",
"us-gov-west-1", "us-west-1",
"us-west-2", "cn-north-1"]
}
}
}

View file

@ -0,0 +1,38 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: EC2 manifest for instance store AMIs
type: object
properties:
image:
type: object
properties:
bucket: {type: string}
region: {$ref: '#/definitions/aws-region'}
required:
- bucket
- region
provider:
type: object
properties:
credentials:
type: object
properties:
certificate: {type: string}
private-key: {type: string}
user-id:
type: string
pattern: (^arn:aws:iam::\d*:user/\w.*$)|(^\d{4}-\d{4}-\d{4}$)
required: [image]
definitions:
aws-region:
enum:
- ap-northeast-1
- ap-southeast-1
- ap-southeast-2
- eu-west-1
- sa-east-1
- us-east-1
- us-gov-west-1
- us-west-1
- us-west-2
- cn-north-1

View file

@ -1,56 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "EC2 manifest",
"type": "object",
"properties": {
"provider": {
"type": "object",
"properties": {
"virtualization": { "enum": ["pvm", "hvm"] },
"credentials": {
"type": "object",
"properties": {
"access-key": {
"type": "string"
},
"secret-key": {
"type": "string"
}
}
}
},
"required": ["virtualization"]
},
"image": {
"type": "object",
"properties": {
"description": {
"type": "string"
}
}
},
"system": {
"type": "object",
"properties": {
"bootloader": {
"type": "string",
"enum": ["pvgrub", "extlinux"]
}
}
},
"volume": {
"type": "object",
"properties": {
"backing": { "enum": ["ebs", "s3"] },
"partitions": {
"type": "object",
"properties": {
"type": { "enum": ["none", "msdos", "gpt"] }
}
}
},
"required": ["backing"]
}
},
"required": ["image"]
}

View file

@ -0,0 +1,47 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: EC2 manifest
type: object
properties:
image:
type: object
properties:
description: {type: string}
provider:
type: object
properties:
credentials:
type: object
properties:
access-key: {type: string}
secret-key: {type: string}
virtualization:
enum:
- pvm
- hvm
required: [virtualization]
system:
type: object
properties:
bootloader:
type: string
enum:
- pvgrub
- extlinux
volume:
type: object
properties:
backing:
enum:
- ebs
- s3
partitions:
type: object
properties:
type:
enum:
- none
- msdos
- gpt
required: [backing]
required: [image]

View file

@ -1,34 +0,0 @@
// This is a mapping of EC2 regions to processor architectures to Amazon Kernel Images
// Source: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html#AmazonKernelImageIDs
{
"ap-northeast-1": // Asia Pacific (Tokyo) Region
{"i386": "aki-136bf512", // pv-grub-hd0_1.04-i386.gz
"amd64": "aki-176bf516"}, // pv-grub-hd0_1.04-x86_64.gz
"ap-southeast-1": // Asia Pacific (Singapore) Region
{"i386": "aki-ae3973fc", // pv-grub-hd0_1.04-i386.gz
"amd64": "aki-503e7402"}, // pv-grub-hd0_1.04-x86_64.gz
"ap-southeast-2": // Asia Pacific (Sydney) Region
{"i386": "aki-cd62fff7", // pv-grub-hd0_1.04-i386.gz
"amd64": "aki-c362fff9"}, // pv-grub-hd0_1.04-x86_64.gz
"eu-west-1": // EU (Ireland) Region
{"i386": "aki-68a3451f", // pv-grub-hd0_1.04-i386.gz
"amd64": "aki-52a34525"}, // pv-grub-hd0_1.04-x86_64.gz
"sa-east-1": // South America (Sao Paulo) Region
{"i386": "aki-5b53f446", // pv-grub-hd0_1.04-i386.gz
"amd64": "aki-5553f448"}, // pv-grub-hd0_1.04-x86_64.gz
"us-east-1": // US East (Northern Virginia) Region
{"i386": "aki-8f9dcae6", // pv-grub-hd0_1.04-i386.gz
"amd64": "aki-919dcaf8"}, // pv-grub-hd0_1.04-x86_64.gz
"us-gov-west-1": // AWS GovCloud (US)
{"i386": "aki-1fe98d3c", // pv-grub-hd0_1.04-i386.gz
"amd64": "aki-1de98d3e"}, // pv-grub-hd0_1.04-x86_64.gz
"us-west-1": // US West (Northern California) Region
{"i386": "aki-8e0531cb", // pv-grub-hd0_1.04-i386.gz
"amd64": "aki-880531cd"}, // pv-grub-hd0_1.04-x86_64.gz
"us-west-2": // US West (Oregon) Region
{"i386": "aki-f08f11c0", // pv-grub-hd0_1.04-i386.gz
"amd64": "aki-fc8f11cc"}, // pv-grub-hd0_1.04-x86_64.gz
"cn-north-1":// China North (Beijing) Region
{"i386": "aki-908f1da9", // pv-grub-hd0_1.04-i386.gz
"amd64": "aki-9e8f1da7"} // pv-grub-hd0_1.04-x86_64.gz
}

View file

@ -0,0 +1,33 @@
---
# This is a mapping of EC2 regions to processor architectures to Amazon Kernel Images
# Source: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html#AmazonKernelImageIDs
ap-northeast-1:
amd64: aki-176bf516
i386: aki-136bf512
ap-southeast-1:
amd64: aki-503e7402
i386: aki-ae3973fc
ap-southeast-2:
amd64: aki-c362fff9
i386: aki-cd62fff7
eu-west-1:
amd64: aki-52a34525
i386: aki-68a3451f
sa-east-1:
amd64: aki-5553f448
i386: aki-5b53f446
us-east-1:
amd64: aki-919dcaf8
i386: aki-8f9dcae6
us-gov-west-1:
amd64: aki-1de98d3e
i386: aki-1fe98d3c
us-west-1:
amd64: aki-880531cd
i386: aki-8e0531cb
us-west-2:
amd64: aki-fc8f11cc
i386: aki-f08f11c0
cn-north-1:
amd64: aki-9e8f1da7
i386: aki-908f1da9

View file

@ -117,7 +117,7 @@ class RegisterAMI(Task):
registration_params['virtualization_type'] = 'hvm'
else:
registration_params['virtualization_type'] = 'paravirtual'
akis_path = os.path.join(os.path.dirname(__file__), 'ami-akis.json')
akis_path = os.path.join(os.path.dirname(__file__), 'ami-akis.yml')
from bootstrapvz.common.tools import config_get
registration_params['kernel_id'] = config_get(akis_path, [info._ec2['region'],
info.manifest.system['architecture']])

View file

@ -1,15 +0,0 @@
// This is a mapping of Debian release codenames to processor architectures to kernel packages
{
"squeeze": // In squeeze, we need a special kernel flavor for xen
{"i386": "linux-image-xen-686",
"amd64": "linux-image-xen-amd64"},
"wheezy":
{"i386": "linux-image-686",
"amd64": "linux-image-amd64"},
"jessie":
{"i386": "linux-image-686-pae",
"amd64": "linux-image-amd64"},
"sid":
{"i386": "linux-image-686-pae",
"amd64": "linux-image-amd64"}
}

View file

@ -0,0 +1,14 @@
---
# This is a mapping of Debian release codenames to processor architectures to kernel packages
squeeze: # In squeeze, we need a special kernel flavor for xen
amd64: linux-image-xen-amd64
i386: linux-image-xen-686
wheezy:
amd64: linux-image-amd64
i386: linux-image-686
jessie:
amd64: linux-image-amd64
i386: linux-image-686-pae
sid:
amd64: linux-image-amd64
i386: linux-image-686-pae

View file

@ -21,7 +21,7 @@ class DefaultPackages(Task):
info.exclude_packages.add('isc-dhcp-common')
import os.path
kernel_packages_path = os.path.join(os.path.dirname(__file__), 'packages-kernels.json')
kernel_packages_path = os.path.join(os.path.dirname(__file__), 'packages-kernels.yml')
from bootstrapvz.common.tools import config_get
kernel_package = config_get(kernel_packages_path, [info.release_codename,
info.manifest.system['architecture']])

View file

@ -18,7 +18,7 @@ def initialize():
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,43 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "GCE manifest",
"type": "object",
"properties": {
"image": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"gcs_destination": {
"type": "string"
},
"gce_project": {
"type": "string"
}
}
},
"system": {
"type": "object",
"properties": {
"bootloader": {
"type": "string",
"enum": ["grub", "extlinux"]
}
}
},
"volume": {
"type": "object",
"properties": {
"partitions": {
"type": "object",
"properties": {
"type": { "enum": ["msdos"] }
}
}
},
"required": ["partitions"]
}
}
}

View file

@ -0,0 +1,29 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: GCE manifest
type: object
properties:
image:
type: object
properties:
description: {type: string}
gce_project: {type: string}
gcs_destination: {type: string}
system:
type: object
properties:
bootloader:
type: string
enum:
- grub
- extlinux
volume:
type: object
properties:
partitions:
type: object
properties:
type:
enum:
- msdos
required: [partitions]

View file

@ -21,7 +21,7 @@ class DefaultPackages(Task):
info.packages.add('openssh-server')
info.packages.add('dhcpd')
kernel_packages_path = os.path.join(os.path.dirname(__file__), '../../ec2/tasks/packages-kernels.json')
kernel_packages_path = os.path.join(os.path.dirname(__file__), '../../ec2/tasks/packages-kernels.yml')
from bootstrapvz.common.tools import config_get
kernel_package = config_get(kernel_packages_path, [info.release_codename,
info.manifest.system['architecture']])

View file

@ -11,7 +11,7 @@ def initialize():
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,50 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "KVM manifest",
"type": "object",
"properties": {
"provider": {
"type": "object",
"properties": {
"virtio": {
"type": "array",
"items": {
"type": "string",
"enum": ["virtio",
"virtio_pci",
"virtio_balloon",
"virtio_blk",
"virtio_net",
"virtio_ring"]
},
"minItems": 1
}
}
},
"system": {
"type": "object",
"properties": {
"bootloader": {
"type": "string",
"enum": ["grub", "extlinux"]
}
}
},
"volume": {
"type": "object",
"properties": {
"backing": {
"type": "string",
"enum": ["raw"]
},
"partitions": {
"type": "object",
"properties": {
"type": { "enum": ["none", "msdos", "gpt"] }
}
}
},
"required": ["backing"]
}
}
}

View file

@ -0,0 +1,44 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: KVM manifest
type: object
properties:
provider:
type: object
properties:
virtio:
type: array
items:
type: string
enum:
- virtio
- virtio_pci
- virtio_balloon
- virtio_blk
- virtio_net
- virtio_ring
minItems: 1
system:
type: object
properties:
bootloader:
type: string
enum:
- grub
- extlinux
volume:
type: object
properties:
backing:
type: string
enum: [raw]
partitions:
type: object
properties:
type:
type: string
enum:
- none
- msdos
- gpt
required: [backing]

View file

@ -9,7 +9,7 @@ def initialize():
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)

View file

@ -1,40 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "VirtualBox manifest",
"type": "object",
"properties": {
"bootstrapper": {
"type": "object",
"properties": {
"guest_additions": {
"type": "string"
}
}
},
"system": {
"type": "object",
"properties": {
"bootloader": {
"type": "string",
"enum": ["grub", "extlinux"]
}
}
},
"volume": {
"type": "object",
"properties": {
"backing": {
"type": "string",
"enum": ["raw", "vdi", "vmdk"]
},
"partitions": {
"type": "object",
"properties": {
"type": { "enum": ["none", "msdos", "gpt"] }
}
}
},
"required": ["backing"]
}
}
}

View file

@ -0,0 +1,36 @@
---
$schema: http://json-schema.org/draft-04/schema#
title: VirtualBox manifest
type: object
properties:
bootstrapper:
type: object
properties:
guest_additions: {type: string}
system:
type: object
properties:
bootloader:
type: string
enum:
- grub
- extlinux
volume:
type: object
properties:
backing:
type: string
enum:
- raw
- vdi
- vmdk
partitions:
type: object
properties:
type:
type: string
enum:
- none
- msdos
- gpt
required: [backing]

View file

@ -1,45 +0,0 @@
{
"provider": {
"name": "azure",
"waagent": {
"version": "2.0.4"
}
},
"bootstrapper": {
"workspace": "/target",
"mirror": "http://ftp.fr.debian.org/debian/"
},
"image": {
"name": "debian-{system.release}-{system.architecture}-{%y}{%m}{%d}",
"description": "Debian {system.release} {system.architecture}"
},
"system": {
"release": "wheezy",
"architecture": "amd64",
"bootloader": "grub",
"timezone": "UTC",
"locale": "en_US",
"charmap": "UTF-8"
},
"packages": {
},
"volume": {
"backing": "raw",
"partitions": {
"type": "msdos",
"boot": {
"size": "32MiB",
"filesystem": "ext2"
},
"root": {
"size": "7GiB",
"filesystem": "ext4"
}
}
},
"plugins": {
"ntp": {
"servers": ["time.windows.com"]
}
}
}

View file

@ -0,0 +1,33 @@
---
provider:
name: azure
waagent:
version: 2.0.4
bootstrapper:
mirror: http://ftp.fr.debian.org/debian/
workspace: /target
image:
name: debian-{system.release}-{system.architecture}-{%y}{%m}{%d}
description: Debian {system.release} {system.architecture}
system:
release: wheezy
architecture: amd64
bootloader: grub
charmap: UTF-8
locale: en_US
timezone: UTC
volume:
backing: raw
partitions:
type: msdos
boot:
filesystem: ext2
size: 32MiB
root:
filesystem: ext4
size: 7GiB
packages: {}
plugins:
ntp:
servers:
- time.windows.com

View file

@ -1,44 +0,0 @@
{
"provider": {
"name": "ec2",
"virtualization": "hvm",
"credentials": {
// "access-key": null,
// "secret-key": null
}
},
"bootstrapper": {
"workspace": "/target"
},
"image": {
"name": "debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs",
"description": "Debian {system.release} {system.architecture}"
},
"system": {
"release": "wheezy",
"architecture": "amd64",
"bootloader": "extlinux",
"timezone": "UTC",
"locale": "en_US",
"charmap": "UTF-8"
},
"packages": {
"mirror": "http://ftp.cn.debian.org/debian"
},
"volume": {
"backing": "ebs",
"partitions": {
"type": "none",
"root": {
"size": "8GiB",
"filesystem": "ext4"
}
}
},
"plugins": {
"cloud_init": {
"username": "admin",
"metadata_sources": "Ec2"
}
}
}

View file

@ -0,0 +1,32 @@
---
provider:
name: ec2
virtualization: hvm
# credentials:
# access-key: AFAKEACCESSKEYFORAWS
# secret-key: thes3cr3tkeyf0ryourawsaccount/FS4d8Qdva
bootstrapper:
workspace: /target
image:
name: debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs
description: Debian {system.release} {system.architecture}
system:
release: wheezy
architecture: amd64
bootloader: extlinux
charmap: UTF-8
locale: en_US
timezone: UTC
volume:
backing: ebs
partitions:
type: none
root:
filesystem: ext4
size: 8GiB
packages:
mirror: http://ftp.cn.debian.org/debian
plugins:
cloud_init:
metadata_sources: Ec2
username: admin

View file

@ -1,44 +0,0 @@
{
"provider": {
"name": "ec2",
"virtualization": "hvm",
"credentials": {
// "access-key": null,
// "secret-key": null
}
},
"bootstrapper": {
"workspace": "/target"
},
"image": {
"name": "debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs",
"description": "Debian {system.release} {system.architecture}"
},
"system": {
"release": "wheezy",
"architecture": "amd64",
"bootloader": "extlinux",
"timezone": "UTC",
"locale": "en_US",
"charmap": "UTF-8"
},
"packages": {
"mirror": "http://cloudfront.debian.net/debian"
},
"volume": {
"backing": "ebs",
"partitions": {
"type": "none",
"root": {
"size": "8GiB",
"filesystem": "ext4"
}
}
},
"plugins": {
"cloud_init": {
"username": "admin",
"metadata_sources": "Ec2"
}
}
}

View file

@ -0,0 +1,32 @@
---
provider:
name: ec2
virtualization: hvm
# credentials:
# access-key: AFAKEACCESSKEYFORAWS
# secret-key: thes3cr3tkeyf0ryourawsaccount/FS4d8Qdva
bootstrapper:
workspace: /target
image:
name: debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs
description: Debian {system.release} {system.architecture}
system:
release: wheezy
architecture: amd64
bootloader: extlinux
charmap: UTF-8
locale: en_US
timezone: UTC
volume:
backing: ebs
partitions:
type: none
root:
filesystem: ext4
size: 8GiB
packages:
mirror: http://cloudfront.debian.net/debian
plugins:
cloud_init:
metadata_sources: Ec2
username: admin

View file

@ -1,44 +0,0 @@
{
"provider": {
"name": "ec2",
"virtualization": "pvm",
"credentials": {
// "access-key": null,
// "secret-key": null
}
},
"bootstrapper": {
"workspace": "/target"
},
"image": {
"name": "debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs",
"description": "Debian {system.release} {system.architecture}"
},
"system": {
"release": "wheezy",
"architecture": "amd64",
"bootloader": "pvgrub",
"timezone": "UTC",
"locale": "en_US",
"charmap": "UTF-8"
},
"packages": {
"mirror": "http://ftp.cn.debian.org/debian"
},
"volume": {
"backing": "ebs",
"partitions": {
"type": "none",
"root": {
"size": "8GiB",
"filesystem": "ext4"
}
}
},
"plugins": {
"cloud_init": {
"username": "admin",
"metadata_sources": "Ec2"
}
}
}

View file

@ -0,0 +1,32 @@
---
provider:
name: ec2
virtualization: pvm
# credentials:
# access-key: AFAKEACCESSKEYFORAWS
# secret-key: thes3cr3tkeyf0ryourawsaccount/FS4d8Qdva
bootstrapper:
workspace: /target
image:
name: debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs
description: Debian {system.release} {system.architecture}
system:
release: wheezy
architecture: amd64
bootloader: pvgrub
charmap: UTF-8
locale: en_US
timezone: UTC
volume:
backing: ebs
partitions:
type: none
root:
filesystem: ext4
size: 8GiB
packages:
mirror: http://ftp.cn.debian.org/debian
plugins:
cloud_init:
metadata_sources: Ec2
username: admin

View file

@ -1,44 +0,0 @@
{
"provider": {
"name": "ec2",
"virtualization": "pvm",
"credentials": {
// "access-key": null,
// "secret-key": null
}
},
"bootstrapper": {
"workspace": "/target"
},
"image": {
"name": "debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs",
"description": "Debian {system.release} {system.architecture}"
},
"system": {
"release": "wheezy",
"architecture": "amd64",
"bootloader": "pvgrub",
"timezone": "UTC",
"locale": "en_US",
"charmap": "UTF-8"
},
"packages": {
"mirror": "http://cloudfront.debian.net/debian"
},
"volume": {
"backing": "ebs",
"partitions": {
"type": "none",
"root": {
"size": "8GiB",
"filesystem": "ext4"
}
}
},
"plugins": {
"cloud_init": {
"username": "admin",
"metadata_sources": "Ec2"
}
}
}

View file

@ -0,0 +1,32 @@
---
provider:
name: ec2
virtualization: pvm
# credentials:
# access-key: AFAKEACCESSKEYFORAWS
# secret-key: thes3cr3tkeyf0ryourawsaccount/FS4d8Qdva
bootstrapper:
workspace: /target
image:
name: debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs
description: Debian {system.release} {system.architecture}
system:
release: wheezy
architecture: amd64
bootloader: pvgrub
charmap: UTF-8
locale: en_US
timezone: UTC
volume:
backing: ebs
partitions:
type: none
root:
filesystem: ext4
size: 8GiB
packages:
mirror: http://cloudfront.debian.net/debian
plugins:
cloud_init:
metadata_sources: Ec2
username: admin

View file

@ -1,44 +0,0 @@
{
"provider": {
"name": "ec2",
"virtualization": "pvm",
"credentials": {
// "access-key": null,
// "secret-key": null
}
},
"bootstrapper": {
"workspace": "/target"
},
"image": {
"name": "debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs",
"description": "Debian {system.release} {system.architecture}"
},
"system": {
"release": "wheezy",
"architecture": "i386",
"bootloader": "pvgrub",
"timezone": "UTC",
"locale": "en_US",
"charmap": "UTF-8"
},
"packages": {
"mirror": "http://cloudfront.debian.net/debian"
},
"volume": {
"backing": "ebs",
"partitions": {
"type": "none",
"root": {
"size": "8GiB",
"filesystem": "ext4"
}
}
},
"plugins": {
"cloud_init": {
"username": "admin",
"metadata_sources": "Ec2"
}
}
}

View file

@ -0,0 +1,32 @@
---
provider:
name: ec2
virtualization: pvm
# credentials:
# access-key: AFAKEACCESSKEYFORAWS
# secret-key: thes3cr3tkeyf0ryourawsaccount/FS4d8Qdva
bootstrapper:
workspace: /target
image:
name: debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs
description: Debian {system.release} {system.architecture}
system:
release: wheezy
architecture: i386
bootloader: pvgrub
charmap: UTF-8
locale: en_US
timezone: UTC
volume:
backing: ebs
partitions:
type: none
root:
filesystem: ext4
size: 8GiB
packages:
mirror: http://cloudfront.debian.net/debian
plugins:
cloud_init:
metadata_sources: Ec2
username: admin

View file

@ -1,44 +0,0 @@
{
"provider": {
"name": "ec2",
"virtualization": "pvm",
"credentials": {
// "access-key": null,
// "secret-key": null
}
},
"bootstrapper": {
"workspace": "/target"
},
"image": {
"name": "debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs",
"description": "Debian {system.release} {system.architecture}"
},
"system": {
"release": "testing",
"architecture": "amd64",
"bootloader": "pvgrub",
"timezone": "UTC",
"locale": "en_US",
"charmap": "UTF-8"
},
"packages": {
"mirror": "http://cloudfront.debian.net/debian"
},
"volume": {
"backing": "ebs",
"partitions": {
"type": "none",
"root": {
"size": "8GiB",
"filesystem": "ext4"
}
}
},
"plugins": {
"cloud_init": {
"username": "admin",
"metadata_sources": "Ec2"
}
}
}

View file

@ -1,37 +1,32 @@
---
provider:
name: "ec2"
virtualization: "pvm"
credentials:
access-key: ""
secret-key: ""
name: ec2
virtualization: pvm
# credentials:
# access-key: AFAKEACCESSKEYFORAWS
# secret-key: thes3cr3tkeyf0ryourawsaccount/FS4d8Qdva
bootstrapper:
workspace: "/target"
workspace: /target
image:
name: "debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs"
description: "Debian {system.release} {system.architecture}"
name: debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs
description: Debian {system.release} {system.architecture}
system:
release: "testing"
architecture: "amd64"
bootloader: "pvgrub"
timezone: "UTC"
locale: "en_US"
charmap: "UTF-8"
packages:
#mirror: "http://cloudfront.debian.net/debian"
install_standard: true
release: testing
architecture: amd64
bootloader: pvgrub
charmap: UTF-8
locale: en_US
timezone: UTC
volume:
backing: "ebs"
backing: ebs
partitions:
type: "none"
type: none
root:
size: "8GiB"
filesystem: "ext4"
filesystem: ext4
size: 8GiB
packages:
mirror: http://cloudfront.debian.net/debian
plugins:
cloud_init:
username: "admin"
#metadata_sources: "Ec2"
disable_modules:
- "landscape"
- "byobu"
- "ssh-import-id"
metadata_sources: Ec2
username: admin

View file

@ -1,44 +0,0 @@
{
"provider": {
"name": "ec2",
"virtualization": "pvm",
"credentials": {
// "access-key": null,
// "secret-key": null
}
},
"bootstrapper": {
"workspace": "/target"
},
"image": {
"name": "debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs",
"description": "Debian {system.release} {system.architecture}"
},
"system": {
"release": "unstable",
"architecture": "amd64",
"bootloader": "pvgrub",
"timezone": "UTC",
"locale": "en_US",
"charmap": "UTF-8"
},
"packages": {
"mirror": "http://cloudfront.debian.net/debian"
},
"volume": {
"backing": "ebs",
"partitions": {
"type": "none",
"root": {
"size": "8GiB",
"filesystem": "ext4"
}
}
},
"plugins": {
"cloud_init": {
"username": "admin",
"metadata_sources": "Ec2"
}
}
}

View file

@ -0,0 +1,32 @@
---
provider:
name: ec2
virtualization: pvm
# credentials:
# access-key: AFAKEACCESSKEYFORAWS
# secret-key: thes3cr3tkeyf0ryourawsaccount/FS4d8Qdva
bootstrapper:
workspace: /target
image:
name: debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs
description: Debian {system.release} {system.architecture}
system:
release: unstable
architecture: amd64
bootloader: pvgrub
charmap: UTF-8
locale: en_US
timezone: UTC
volume:
backing: ebs
partitions:
type: none
root:
filesystem: ext4
size: 8GiB
packages:
mirror: http://cloudfront.debian.net/debian
plugins:
cloud_init:
metadata_sources: Ec2
username: admin

View file

@ -1,45 +0,0 @@
{
"provider": {
"name": "ec2",
"virtualization": "pvm",
"credentials": {
// "access-key": null,
// "secret-key": null
}
},
"bootstrapper": {
"workspace": "/target"
},
"image": {
"name": "debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs",
"description": "Debian {system.release} {system.architecture}"
},
"system": {
"release": "unstable",
"sections": ["main", "contrib", "non-free"],
"architecture": "amd64",
"bootloader": "pvgrub",
"timezone": "UTC",
"locale": "en_US",
"charmap": "UTF-8"
},
"packages": {
"mirror": "http://cloudfront.debian.net/debian"
},
"volume": {
"backing": "ebs",
"partitions": {
"type": "none",
"root": {
"size": "8GiB",
"filesystem": "ext4"
}
}
},
"plugins": {
"cloud_init": {
"username": "admin",
"metadata_sources": "Ec2"
}
}
}

View file

@ -0,0 +1,36 @@
---
provider:
name: ec2
virtualization: pvm
# credentials:
# access-key: AFAKEACCESSKEYFORAWS
# secret-key: thes3cr3tkeyf0ryourawsaccount/FS4d8Qdva
bootstrapper:
workspace: /target
image:
name: debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs
description: Debian {system.release} {system.architecture}
system:
release: unstable
architecture: amd64
bootloader: pvgrub
charmap: UTF-8
locale: en_US
timezone: UTC
volume:
backing: ebs
partitions:
type: none
root:
filesystem: ext4
size: 8GiB
packages:
mirror: http://cloudfront.debian.net/debian
components:
- main
- contrib
- non-free
plugins:
cloud_init:
metadata_sources: Ec2
username: admin

View file

@ -1,38 +0,0 @@
{
"provider": {
"name": "ec2",
"virtualization": "pvm",
"credentials": {
// "access-key": null,
// "secret-key": null
}
},
"bootstrapper": {
"workspace": "/target"
},
"image": {
"name": "debian-{system.release}-{system.architecture}-{virtualization}-{%y}{%m}{%d}",
"description": "Debian {system.release} {system.architecture} AMI ({virtualization})"
},
"system": {
"release": "wheezy",
"architecture": "amd64",
"bootloader": "pvgrub",
"timezone": "UTC",
"locale": "en_US",
"charmap": "UTF-8"
},
"packages": {
"mirror": "http://cloudfront.debian.net/debian"
},
"volume": {
"backing": "ebs",
"partitions": {
"type": "msdos",
"root": {
"size": "1GiB",
"filesystem": "ext4"
}
}
}
}

Some files were not shown because too many files have changed in this diff Show more