bundlewrap/bundles/unbound/items.py

57 lines
1.5 KiB
Python
Raw Permalink Normal View History

files = {
'/etc/unbound/unbound.conf': {
'content_type': 'mako',
'context': node.metadata['unbound'],
'triggers': {
'svc_systemd:unbound:restart',
},
},
'/usr/local/sbin/unbound-auto-restart': {
'mode': '0755',
},
}
actions = {
'unbound_generate_certificates': {
2020-12-13 14:17:19 +00:00
'command': 'unbound-control-setup && chmod 0644 /etc/unbound/unbound_control.*',
'unless': 'test -f /etc/unbound/unbound_server.key',
'needs': {
'pkg_apt:unbound',
'pkg_apt:unbound-anchor',
},
},
'unbound_download_root_hints': {
'command': 'wget -O/etc/unbound/root-hints.txt https://www.internic.net/domain/named.root',
'unless': 'test -f /etc/unbound/root-hints.txt',
'needs': {
'pkg_apt:unbound',
},
},
}
svc_systemd = {
'unbound': {
'needs': {
'action:unbound_generate_certificates',
'action:unbound_download_root_hints',
'file:/etc/unbound/unbound.conf',
'pkg_apt:unbound',
'pkg_apt:unbound-anchor',
},
},
}
if node.has_bundle('systemd-networkd'):
svc_systemd['unbound']['needed_by'] = {
'file:/etc/resolv.conf',
}
2020-12-13 14:17:19 +00:00
if node.has_bundle('pppd'):
files['/etc/systemd/system/unbound.service.d/bundlewrap.conf'] = {
'source': 'override.conf',
'triggers': {
'action:systemd-reload',
'svc_systemd:unbound:restart',
},
}