Commit 8b0e16e8 authored by Łukasz Nowak's avatar Łukasz Nowak

XXX software/dnsresolver: Introduce

XXX:
 * cover with tests
 * split to stack to eventually use the local v4 access
 * add proper README.rst
 * add missing udp listening promise
parent e8c05247
Pipeline #26609 running with stage
in 0 seconds
[instance.cfg]
filename = instance.cfg
md5sum = 12cfb5c52ebe6363482f23809adb1371
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"nameserver-list": {
"description": "List of nameservers to use",
"items": {
"type": "string"
},
"uniqueItems": true,
"type": "array"
},
"cache-size": {
"description": "Size of the entry cache",
"type": "number",
"default": 5000
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Values returned by instanciation",
"properties": {
"dnsresolver": {
"description": "Connection address of the resolver",
"type": "string"
}
},
"type": "object"
}
[buildout]
parts =
dnsmasq-service
dnsmasq-promise-v6
dnsmasq-promise-v4
publish-connection-parameter
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
extends = ${monitor2-template:output}
[directory]
recipe = slapos.cookbook:mkdirectory
home = $${buildout:directory}
etc = $${:home}/etc/
var = $${:home}/var/
run = $${:var}/run/
bin = $${:home}/bin/
services = $${:etc}/service/
[instance-parameter]
recipe = slapos.cookbook:slapconfiguration
computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
[publish-connection-parameter]
recipe = slapos.cookbook:publish.serialised
dnsresolver = [$${slap-configuration:ipv6-random}]:$${dnsmasq-service:port}
[dnsmasq-config]
recipe = slapos.recipe.template:jinja2
output = $${directory:etc}/dnsmasq.conf
port = 5353
context =
key configuration slap-configuration:configuration
inline =
port=$${:port}
listen-address=$${slap-configuration:ipv6-random}
listen-address=$${slap-configuration:ipv4-random}
{%- for nameserver in configuration['nameserver-list'] %}
server={{ nameserver }}
{%- endfor %}
cache-size={{ configuration.get('cache-size', 5000) }}
bind-interfaces
no-resolv
keep-in-foreground
[dnsmasq-service]
recipe = slapos.cookbook:wrapper
command-line = ${dnsmasq-output:dnsmasq} -C $${dnsmasq-config:output}
hash-existing-files = $${buildout:directory}/buildout.cfg
hash-files = $${dnsmasq-config:output}
wrapper-path = $${directory:services}/dnsmasq
port = $${dnsmasq-config:port}
[dnsmasq-promise-v6]
<= monitor-promise-base
promise = check_socket_listening
name = dnsmasq-v6.py
config-host = $${slap-configuration:ipv6-random}
config-port = $${dnsmasq-service:port}
[dnsmasq-promise-v4]
<= dnsmasq-promise-v6
name = dnsmasq-v4.py
config-host = $${slap-configuration:ipv4-random}
[buildout]
extends =
buildout.hash.cfg
../../stack/slapos.cfg
../../component/dnsmasq/buildout.cfg
../../stack/monitor/buildout.cfg
parts =
instance.cfg
slapos-cookbook
[instance.cfg]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance.cfg
{
"name": "DNS Resolver",
"description": "DNS Resolver using dnsmasq, for reliable DNS service",
"serialisation": "json-in-xml",
"software-type": {
"default": {
"title": "Default",
"software-type": "default",
"description": "Default",
"request": "instance-input-schema.json",
"response": "instance-output-schema.json",
"index": 1
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment