bundlewrap/nodes/sophie/vmhost.py

139 lines
4.2 KiB
Python

nodes['sophie.vmhost'] = {
'hostname': '172.19.164.2',
'bundles': {
'backup-client',
'lm-sensors',
'nfs-server',
'mosquitto',
'smartd',
'vmhost',
'zfs',
},
'groups': {
'debian-bookworm',
},
'metadata': {
'groups': {
'nas': {},
},
'interfaces': {
'br1': {
'ips': {
'172.19.164.2/24',
},
'gateway4': '172.19.164.1',
'ipv6_accept_ra': True,
},
},
'mosquitto': {
'bridges': {
'c3voc': {
'peer': 'mqtt.c3voc.de',
'client_id': 'sophie-vm-host',
'auth': {
'username': vault.decrypt('encrypt$gAAAAABgaBa5UZyZlsMM9TV5pa-VyOieFWYzAslxWVnXjOeXHvF4kMHHSHSMOrv-U9k7Ec3mMCDuJFO3ybpOsZSeFQDL7GgEfw=='),
'password': vault.decrypt('encrypt$gAAAAABgaBbfm65cYBuod0UehWNmY0NfeUH9xsrP2kENYNF_LWP2iV5a8db_cqMoITwyjjBsHpvjaeDq07Z5K5nQ_BLZG6zPqapL-Qvp20wyck49Dy2R4V4='),
},
'topics': [
{
'pattern': '#',
'remote_prefix': '/voc/',
'local_prefix': 'voc'
},
],
},
},
'listeners': {
'8083': {
'protocol': 'websockets',
},
},
'tasmota-telegraf-topic': '/switch/#',
'restrict-to': {
'172.19.164.0/24',
},
},
'nfs-server': {
'shares': {
'/srv/nas': {
'172.19.164.0/24': 'ro,all_squash,anonuid=65534,anongid=65534,no_subtree_check',
},
},
},
'smartd': {
'disks': {
'/dev/nvme0',
# nas disks
'/dev/disk/by-id/ata-ST20000NM007D-3DJ103_ZVT7BHBQ',
'/dev/disk/by-id/ata-ST20000NM007D-3DJ103_ZVT7D6JP',
},
},
'systemd-networkd': {
'bridges': {
'br0': {
'match': {
'enp1s0',
},
},
'br1': {
'match': {
'br0.1',
},
},
},
},
'systemd-timers': {
'timers': {
# Ensure every user is able to read and write to the NAS dataset.
'nas_permissions': {
'command': [
'chown -R :nas /srv/nas/',
r'find /srv/nas/ -type d -exec chmod 0775 {} \;',
r'find /srv/nas/ -type f -exec chmod 0664 {} \;',
],
'when': '*-*-* 02:00:00',
},
},
},
'users': {
'sophie': {
'groups': {
'nas',
},
},
},
'zfs': {
'pools': {
'storage': {
'when_creating': {
'config': [{
'devices': {
'/dev/disk/by-id/nvme-SAMSUNG_MZVLB256HAHQ-000L7_S41GNX0M481966-part3',
},
}]
}
},
'nas': {
'when_creating': {
'config': [{
'type': 'mirror',
'devices': {
'/dev/disk/by-id/ata-ST20000NM007D-3DJ103_ZVT7BHBQ',
'/dev/disk/by-id/ata-ST20000NM007D-3DJ103_ZVT7D6JP',
},
}]
}
}
},
"datasets": {
"storage/libvirt": {
"mountpoint": "/var/lib/libvirt",
},
"nas": {
"mountpoint": "/srv/nas",
},
},
},
},
}