sophie/vmhost: new disksgit add sophie/vmhost.py git add sophie/vmhost.py

This commit is contained in:
Sophie Schiller 2025-04-03 20:08:25 +02:00
parent 5e32a562ec
commit 5a4c3284b6

View file

@ -3,6 +3,7 @@ nodes['sophie.vmhost'] = {
'bundles': {
'backup-client',
'lm-sensors',
'nfs-server',
'mosquitto',
'smartd',
'vmhost',
@ -12,6 +13,9 @@ nodes['sophie.vmhost'] = {
'debian-bookworm',
},
'metadata': {
'groups': {
'nas': {},
},
'interfaces': {
'br1': {
'ips': {
@ -49,11 +53,27 @@ nodes['sophie.vmhost'] = {
'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': {
'eno1',
'enp1s0',
},
},
'br1': {
@ -63,6 +83,26 @@ nodes['sophie.vmhost'] = {
},
},
},
'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': {
@ -73,12 +113,26 @@ nodes['sophie.vmhost'] = {
},
}]
}
},
'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",
},
},
},
},