mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-10-07 17:40:30 +00:00
commit
151dcf5a85
6 changed files with 74 additions and 1 deletions
|
@ -1,6 +1,12 @@
|
||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
2016-02-23
|
||||||
|
----------
|
||||||
|
Nicolas Braud-Santoni:
|
||||||
|
* #282, #290: Added 'debconf' plugin
|
||||||
|
* #290: Relaxed requirements on plugins manifests
|
||||||
|
|
||||||
2016-02-10
|
2016-02-10
|
||||||
----------
|
----------
|
||||||
Manoj Srivastava:
|
Manoj Srivastava:
|
||||||
|
|
|
@ -121,7 +121,8 @@ properties:
|
||||||
plugins:
|
plugins:
|
||||||
type: object
|
type: object
|
||||||
patternProperties:
|
patternProperties:
|
||||||
^\w+$: {type: object}
|
^\w+$: {}
|
||||||
|
additionalProperties: false
|
||||||
volume:
|
volume:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
24
bootstrapvz/plugins/debconf/README.rst
Normal file
24
bootstrapvz/plugins/debconf/README.rst
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
debconf
|
||||||
|
-------
|
||||||
|
|
||||||
|
``debconf(7)`` is the configuration system for Debian packages.
|
||||||
|
It enables you to preconfigure packages before their installation.
|
||||||
|
|
||||||
|
This plugin lets you specify debconf answers directly in the manifest.
|
||||||
|
You should only specify answers for packages that will be installed; the plugin
|
||||||
|
does not check that this is the case.
|
||||||
|
|
||||||
|
Settings
|
||||||
|
~~~~~~~~
|
||||||
|
|
||||||
|
The ``debconf`` plugin directly takes an inline string:::
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
debconf: >-
|
||||||
|
d-i pkgsel/install-language-support boolean false
|
||||||
|
popularity-contest popularity-contest/participate boolean false
|
||||||
|
|
||||||
|
|
||||||
|
Consult ``debconf-set-selections(1)`` for a description of the data format.
|
||||||
|
|
||||||
|
|
13
bootstrapvz/plugins/debconf/__init__.py
Normal file
13
bootstrapvz/plugins/debconf/__init__.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
def validate_manifest(data, validator, error):
|
||||||
|
from bootstrapvz.common.tools import log_check_call
|
||||||
|
import os.path
|
||||||
|
schema_path = os.path.join(os.path.dirname(__file__),
|
||||||
|
'schema.yaml')
|
||||||
|
validator(data, schema_path)
|
||||||
|
log_check_call(['debconf-set-selections', '--checkonly'],
|
||||||
|
stdin=data['plugins']['debconf'])
|
||||||
|
|
||||||
|
|
||||||
|
def resolve_tasks(taskset, manifest):
|
||||||
|
import tasks
|
||||||
|
taskset.update([tasks.DebconfSetSelections])
|
14
bootstrapvz/plugins/debconf/schema.yaml
Normal file
14
bootstrapvz/plugins/debconf/schema.yaml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
$schema: http://json-schema.org/schema#
|
||||||
|
title: Manifest schema for the debconf plugin
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
plugins:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
debconf:
|
||||||
|
name: Debconf selections to set
|
||||||
|
description: >-
|
||||||
|
This value should be an inline string in the
|
||||||
|
input format of debconf-set-selections(1).
|
||||||
|
type: string
|
||||||
|
required: [debconf]
|
15
bootstrapvz/plugins/debconf/tasks.py
Normal file
15
bootstrapvz/plugins/debconf/tasks.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
from bootstrapvz.base import Task
|
||||||
|
from bootstrapvz.common import phases
|
||||||
|
from bootstrapvz.common.tasks import packages
|
||||||
|
from bootstrapvz.common.tools import log_check_call
|
||||||
|
|
||||||
|
|
||||||
|
class DebconfSetSelections(Task):
|
||||||
|
description = 'Set debconf(7) selections from the manifest'
|
||||||
|
phase = phases.package_installation
|
||||||
|
successors = [packages.InstallPackages]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def run(cls, info):
|
||||||
|
log_check_call(['chroot', info.root, 'debconf-set-selections'],
|
||||||
|
stdin=info.manifest.plugins['debconf'])
|
Loading…
Add table
Reference in a new issue