mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Fix #104. Remove "enabled" from plugin manifests
This commit is contained in:
parent
663b868b41
commit
71be571f93
7 changed files with 11 additions and 27 deletions
|
@ -44,13 +44,7 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"patternProperties": {
|
"patternProperties": {
|
||||||
"^\\w+$": {
|
"^\\w+$": {
|
||||||
"type": "object",
|
"type": "object"
|
||||||
"properties": {
|
|
||||||
"enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["enabled"]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|
|
@ -57,14 +57,13 @@ class Manifest(object):
|
||||||
self.loaded_plugins = []
|
self.loaded_plugins = []
|
||||||
if 'plugins' in data:
|
if 'plugins' in data:
|
||||||
for plugin_name, plugin_data in data['plugins'].iteritems():
|
for plugin_name, plugin_data in data['plugins'].iteritems():
|
||||||
if plugin_data['enabled']:
|
modname = 'plugins.{plugin_name}'.format(plugin_name=plugin_name)
|
||||||
modname = 'plugins.{plugin_name}'.format(plugin_name=plugin_name)
|
plugin = __import__(modname, fromlist=['plugins'])
|
||||||
plugin = __import__(modname, fromlist=['plugins'])
|
init = getattr(plugin, 'initialize', None)
|
||||||
init = getattr(plugin, 'initialize', None)
|
if callable(init):
|
||||||
if callable(init):
|
init()
|
||||||
init()
|
log.debug('Loaded plugin `%s\'', plugin_name)
|
||||||
log.debug('Loaded plugin `%s\'', plugin_name)
|
self.loaded_plugins.append(plugin)
|
||||||
self.loaded_plugins.append(plugin)
|
validate = getattr(plugin, 'validate_manifest', None)
|
||||||
validate = getattr(plugin, 'validate_manifest', None)
|
if callable(validate):
|
||||||
if callable(validate):
|
validate(data, self.schema_validate)
|
||||||
validate(data, self.schema_validate)
|
|
||||||
|
|
|
@ -32,16 +32,13 @@
|
||||||
},
|
},
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"backports": {
|
"backports": {
|
||||||
"enabled": true,
|
|
||||||
"packages": [ "cloud-init" ]
|
"packages": [ "cloud-init" ]
|
||||||
},
|
},
|
||||||
"user_packages": {
|
"user_packages": {
|
||||||
"enabled": true,
|
|
||||||
"repo": [ "sudo" ],
|
"repo": [ "sudo" ],
|
||||||
"local": []
|
"local": []
|
||||||
},
|
},
|
||||||
"sed": {
|
"sed": {
|
||||||
"enabled": true,
|
|
||||||
"file": "etc/cloud/cloud.cfg",
|
"file": "etc/cloud/cloud.cfg",
|
||||||
"find": "^ name: debian$",
|
"find": "^ name: debian$",
|
||||||
"replace": " name: admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash"
|
"replace": " name: admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash"
|
||||||
|
|
|
@ -32,16 +32,13 @@
|
||||||
},
|
},
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"backports": {
|
"backports": {
|
||||||
"enabled": true,
|
|
||||||
"packages": [ "cloud-init" ]
|
"packages": [ "cloud-init" ]
|
||||||
},
|
},
|
||||||
"user_packages": {
|
"user_packages": {
|
||||||
"enabled": true,
|
|
||||||
"repo": [ "sudo" ],
|
"repo": [ "sudo" ],
|
||||||
"local": []
|
"local": []
|
||||||
},
|
},
|
||||||
"sed": {
|
"sed": {
|
||||||
"enabled": true,
|
|
||||||
"file": "etc/cloud/cloud.cfg",
|
"file": "etc/cloud/cloud.cfg",
|
||||||
"find": "^ name: debian$",
|
"find": "^ name: debian$",
|
||||||
"replace": " name: admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash"
|
"replace": " name: admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash"
|
||||||
|
|
|
@ -4,7 +4,6 @@ Supported formats are the one supported by qemu-img.
|
||||||
In the plugins section add:
|
In the plugins section add:
|
||||||
|
|
||||||
"convert_image": {
|
"convert_image": {
|
||||||
"enabled": true,
|
|
||||||
"format": "vdi"
|
"format": "vdi"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ This plugin gives the possibility to the user to execute commands.
|
||||||
Plugin is defined in the manifest file, plugin section with:
|
Plugin is defined in the manifest file, plugin section with:
|
||||||
|
|
||||||
"image_commands": {
|
"image_commands": {
|
||||||
"enabled": true,
|
|
||||||
"commands": [ [ "touch", "/var/www/index.html" ]],
|
"commands": [ [ "touch", "/var/www/index.html" ]],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ This plugin gives the possibility to the user to install Debian packages in the
|
||||||
Plugin is defined in the manifest file, plugin section with:
|
Plugin is defined in the manifest file, plugin section with:
|
||||||
|
|
||||||
"user_packages": {
|
"user_packages": {
|
||||||
"enabled": true,
|
|
||||||
"repo": [ "apache2" ],
|
"repo": [ "apache2" ],
|
||||||
"local": [ "/tmp/mypackage.deb" ]
|
"local": [ "/tmp/mypackage.deb" ]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue