wip
This commit is contained in:
parent
ddf331f4f0
commit
9152574276
7 changed files with 35 additions and 7 deletions
|
@ -23,6 +23,9 @@ files['/etc/default/bind9'] = {
|
||||||
files['/etc/bind/named.conf'] = {
|
files['/etc/bind/named.conf'] = {
|
||||||
'owner': 'root',
|
'owner': 'root',
|
||||||
'group': 'bind',
|
'group': 'bind',
|
||||||
|
'needs': [
|
||||||
|
'pkg_apt:bind9',
|
||||||
|
],
|
||||||
'needed_by': [
|
'needed_by': [
|
||||||
'svc_systemd:bind9',
|
'svc_systemd:bind9',
|
||||||
],
|
],
|
||||||
|
|
|
@ -90,8 +90,8 @@ def vhosts(metadata):
|
||||||
def dns(metadata):
|
def dns(metadata):
|
||||||
return {
|
return {
|
||||||
'dns': {
|
'dns': {
|
||||||
domain: repo.libs.dns.get_a_records(metadata)
|
domain: repo.libs.dns.get_a_records(metadata, internal=config.get('internal_dns', True))
|
||||||
for domain in metadata.get('nginx/vhosts')
|
for domain, config in metadata.get('nginx/vhosts').items()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,18 @@
|
||||||
from bundlewrap.utils.dicts import merge_dict
|
from bundlewrap.utils.dicts import merge_dict
|
||||||
|
|
||||||
|
directories = {
|
||||||
|
'/var/lib/postgresql': {
|
||||||
|
'owner': 'postgres',
|
||||||
|
'group': 'postgres',
|
||||||
|
'needs': [
|
||||||
|
'zfs_dataset:tank/postgresql',
|
||||||
|
],
|
||||||
|
'needed_by': [
|
||||||
|
'svc_systemd:postgresql',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
svc_systemd['postgresql'] = {
|
svc_systemd['postgresql'] = {
|
||||||
'needs': [
|
'needs': [
|
||||||
|
|
|
@ -11,7 +11,8 @@ defaults = {
|
||||||
'php-intl': {},
|
'php-intl': {},
|
||||||
'php-mail-mime': {},
|
'php-mail-mime': {},
|
||||||
'php-mbstring': {},
|
'php-mbstring': {},
|
||||||
'php-net-idna2': {},
|
# FIXME: not available in bullseye?
|
||||||
|
# 'php-net-idna2': {},
|
||||||
'php-net-smtp': {},
|
'php-net-smtp': {},
|
||||||
'php-net-socket': {},
|
'php-net-socket': {},
|
||||||
'php-pear': {},
|
'php-pear': {},
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
'dovecot',
|
'dovecot',
|
||||||
'letsencrypt',
|
'letsencrypt',
|
||||||
'mailserver',
|
'mailserver',
|
||||||
|
'nginx',
|
||||||
'php',
|
'php',
|
||||||
'postfix',
|
'postfix',
|
||||||
'postgresql',
|
'postgresql',
|
||||||
|
|
14
libs/dns.py
14
libs/dns.py
|
@ -1,15 +1,23 @@
|
||||||
from ipaddress import ip_interface
|
from ipaddress import ip_interface
|
||||||
|
|
||||||
def get_a_records(metadata):
|
def get_a_records(metadata, internal=True, external=True):
|
||||||
|
networks = metadata.get('network')
|
||||||
|
|
||||||
|
if not internal:
|
||||||
|
networks.pop('internal')
|
||||||
|
|
||||||
|
if not external:
|
||||||
|
networks.pop('external')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'A': [
|
'A': [
|
||||||
str(ip_interface(network['ipv4']).ip)
|
str(ip_interface(network['ipv4']).ip)
|
||||||
for network in metadata.get('network').values()
|
for network in networks.values()
|
||||||
if 'ipv4' in network
|
if 'ipv4' in network
|
||||||
],
|
],
|
||||||
'AAAA': [
|
'AAAA': [
|
||||||
str(ip_interface(network['ipv6']).ip)
|
str(ip_interface(network['ipv6']).ip)
|
||||||
for network in metadata.get('network').values()
|
for network in networks.values()
|
||||||
if 'ipv6' in network
|
if 'ipv6' in network
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# 'archive',
|
# 'archive',
|
||||||
'backup',
|
'backup',
|
||||||
'hetzner-cloud',
|
'hetzner-cloud',
|
||||||
'debian-10',
|
'debian-11',
|
||||||
'mailserver',
|
'mailserver',
|
||||||
'monitored',
|
'monitored',
|
||||||
'webserver',
|
'webserver',
|
||||||
|
@ -65,12 +65,14 @@
|
||||||
'context': {
|
'context': {
|
||||||
'target': 'https://cloud.sublimity.de:443',
|
'target': 'https://cloud.sublimity.de:443',
|
||||||
},
|
},
|
||||||
|
'internal_dns': False,
|
||||||
},
|
},
|
||||||
'git.sublimity.de': {
|
'git.sublimity.de': {
|
||||||
'content': 'nginx/proxy_pass.conf',
|
'content': 'nginx/proxy_pass.conf',
|
||||||
'context': {
|
'context': {
|
||||||
'target': 'https://git.sublimity.de:443',
|
'target': 'https://git.sublimity.de:443',
|
||||||
},
|
},
|
||||||
|
'internal_dns': False,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue