X-Git-Url: https://git.llucax.com/software/pymin.git/blobdiff_plain/3a113e91bcbc8e34d9ef66915ccec80e6187332b..1917762a115dee700b1abea8ea3072042fab8232:/services/dns/__init__.py diff --git a/services/dns/__init__.py b/services/dns/__init__.py index 1b5e4e5..882cdd1 100644 --- a/services/dns/__init__.py +++ b/services/dns/__init__.py @@ -1,7 +1,22 @@ # vim: set encoding=utf-8 et sw=4 sts=4 : +from formencode import validators as V +from pymin.config import Option from handler import DnsHandler +def setup_service(options, config): + options.add_group('dns', 'DNS service', [ + Option('pickle_dir', V.String, metavar='DIR', + help='store persistent data in DIR directory'), + Option('config_named_dir', V.String, metavar='DIR', + help='write named config files in DIR directory'), + Option('config_zones_dir', V.String, metavar='DIR', + help='write zone config files in DIR directory'), + ]) + def get_service(config): - return DnsHandler(config.dns.pickle_dir, config.dns.config_dir) + return DnsHandler(config.dns.pickle_dir, { + 'named.conf': config.dns.config_named_dir, + 'zoneX.zone': config.dns.config_zones_dir, + })