This commit is contained in:
mwiegand 2021-06-26 16:51:12 +02:00
parent fa576f4b5c
commit 394a7a3b3f
6 changed files with 28 additions and 12 deletions

View file

@ -43,19 +43,23 @@ def zfs(metadata):
@metadata_reactor.provides( @metadata_reactor.provides(
'dns' 'dns',
) )
def dns(metadata): def dns(metadata):
records = {}
if metadata.get('network/ipv4', None):
records['A'] = [str(ip_interface(metadata.get('network/ipv4')).ip)]
if metadata.get('network/ipv6', None):
records['AAAA'] = [str(ip_interface(metadata.get('network/ipv6')).ip)]
return { return {
'dns': { 'dns': {
metadata.get('backup-server/hostname'): records, metadata.get('backup-server/hostname'): {
'A': [
str(ip_interface(network['ipv4']).ip)
for network in metadata.get('network').values()
if 'ipv4' in network
],
'AAAA': [
str(ip_interface(network['ipv6']).ip)
for network in metadata.get('network').values()
if 'ipv6' in network
],
},
}, },
} }

View file

@ -101,7 +101,7 @@ plugin {
fts_decoder = decode2text fts_decoder = decode2text
} }
service indexer-worker { service indexer-worker {
vsz_limit = 1G vsz_limit = ${indexer_ram}
} }
service decode2text { service decode2text {
executable = script /usr/local/libexec/dovecot/decode2text.sh executable = script /usr/local/libexec/dovecot/decode2text.sh

View file

@ -31,6 +31,7 @@ files = {
'content_type': 'mako', 'content_type': 'mako',
'context': { 'context': {
'admin_email': node.metadata.get('mailserver/admin_email'), 'admin_email': node.metadata.get('mailserver/admin_email'),
'indexer_ram': node.metadata.get('dovecot/indexer_ram'),
}, },
'needs': { 'needs': {
'pkg_apt:' 'pkg_apt:'

View file

@ -25,3 +25,13 @@ defaults = {
}, },
}, },
} }
@metadata_reactor.provides(
'dovecot/indexer_ram',
)
def indexer_ram(metadata):
return {
'dovecot': {
'indexer_ram': str(metadata.get('vm/ram')//2)+ 'M',
},
}

View file

@ -1,7 +1,7 @@
version = node.metadata.get('php/version') version = node.metadata.get('php/version')
php_ini_context = { php_ini_context = {
'num_cpus': node.metadata.get('vm/cpu'), 'num_cpus': node.metadata.get('vm/cores'),
'post_max_size': node.metadata.get('php/post_max_size', 10), 'post_max_size': node.metadata.get('php/post_max_size', 10),
} }

View file

@ -94,7 +94,8 @@
'installer': True, 'installer': True,
}, },
'vm': { 'vm': {
'cpu': 2, 'cores': 2,
'ram': 8096,
}, },
'wireguard': { 'wireguard': {
# ip r add 10.0.0.0/24 via 172.19.136.2 dev wg0 # ip r add 10.0.0.0/24 via 172.19.136.2 dev wg0