new opanhab raspi

This commit is contained in:
mwiegand 2021-11-10 01:25:48 +01:00
parent 99c12b6106
commit 9ef958d935
10 changed files with 85 additions and 73 deletions

View file

@ -44,9 +44,15 @@ files = {
},
'/etc/nginx/sites-available': {
'delete': True,
'needs': {
'pkg_apt:nginx',
},
},
'/etc/nginx/sites-enabled': {
'delete': True,
'needs': {
'pkg_apt:nginx',
},
},
}

View file

@ -3,7 +3,18 @@ directories = {
'owner': 'openhab',
'group': 'openhab',
'needs': [
'zfs_dataset:tank/openhab',
'zfs_dataset:tank/openhab/data',
'pkg_apt:openhab',
],
'triggers': [
'svc_systemd:openhab:restart',
],
},
'/etc/openhab': {
'owner': 'openhab',
'group': 'openhab',
'needs': [
'zfs_dataset:tank/openhab/config',
'pkg_apt:openhab',
],
'triggers': [
@ -18,6 +29,8 @@ svc_systemd = {
'needs': [
'pkg_apt:openhab',
'directory:/var/lib/openhab',
'zfs_dataset:tank/openhab/config',
'zfs_dataset:tank/openhab/data',
],
}
}

View file

@ -3,7 +3,8 @@ defaults = {
'packages': {
'openhab': {
'needs': [
'zfs_dataset:tank/openhab',
'zfs_dataset:tank/openhab/config',
'zfs_dataset:tank/openhab/data',
],
},
},
@ -14,6 +15,12 @@ defaults = {
'zfs': {
'datasets': {
'tank/openhab': {
'mountpoint': 'none',
},
'tank/openhab/config': {
'mountpoint': '/etc/openhab',
},
'tank/openhab/data': {
'mountpoint': '/var/lib/openhab',
},
},

View file

@ -8,6 +8,12 @@ files = {
'/etc/cron.daily/zfs-auto-snapshot': {'delete': True},
'/etc/cron.weekly/zfs-auto-snapshot': {'delete': True},
'/etc/cron.monthly/zfs-auto-snapshot': {'delete': True},
'/etc/modprobe.d/zfs.conf': {
'content': '\n'.join(
f'option zfs {k}={v}'
for k, v in node.metadata.get('zfs/kernel_params').items()
) + '\n',
},
}
actions = {

View file

@ -77,6 +77,7 @@ defaults = {
'zfs': {
'datasets': {},
'pools': {},
'kernel_params': {},
},
}

View file

@ -15,5 +15,10 @@
'grafana_rows': {
'health',
},
'zfs': {
'kernel_params': {
'zfs_txg_timeout': 300,
},
},
},
}

View file

@ -7,5 +7,10 @@
'ipv4': '10.0.2.8/24',
},
},
'dns': {
'homematic.ckn.li': {
'A': {'10.0.2.8'},
},
},
},
}

View file

@ -1,19 +1,55 @@
{
'hostname': '10.0.0.14',
'hostname': '10.0.0.17',
'groups': [
'raspberry-pi',
'debian-10',
'debian-11',
'monitored',
'webserver',
],
'bundles': [
'zfs',
'openhab',
'java',
],
'metadata': {
'id': '397d6f7f-f5bb-49ab-bdad-f1404e49d0d5',
'FIXME_dont_touch_sshd': True,
'telegraf': {
'config': {
'agent': {
'flush_interval': '30s',
'interval': '30s',
},
},
},
'id': '0afcde75-95c8-4fbd-b4c2-8a0fcc92884a',
'network': {
'internal': {
'interface': 'eth0',
'ipv4': '10.0.0.14/24',
'ipv4': '10.0.0.17/24',
'gateway4': '10.0.0.1',
},
},
'nginx': {
'vhosts': {
'openhab.ckn.li': {
'content': 'nginx/proxy_pass.conf',
'context': {
'target': 'http://localhost:8080',
},
},
},
},
'java': {
'version': 11,
},
'zfs': {
'pools': {
'tank': {
'devices': [
'/dev/sda',
],
},
},
},
},
}

View file

@ -1,56 +0,0 @@
{
'hostname': '10.0.0.17',
'groups': [
'raspberry-pi',
'debian-11',
'monitored',
'webserver',
],
'bundles': [
'zfs',
'openhab',
'java',
'mirror',
],
'metadata': {
'FIXME_dont_touch_sshd': True,
'telegraf': {
'config': {
'agent': {
'flush_interval': '30s',
'interval': '30s',
},
},
},
'id': '0afcde75-95c8-4fbd-b4c2-8a0fcc92884a',
'network': {
'internal': {
'interface': 'eth0',
'ipv4': '10.0.0.17/24',
'gateway4': '10.0.0.1',
},
},
'nginx': {
'vhosts': {
'openhab.ckn.li': {
'content': 'nginx/proxy_pass.conf',
'context': {
'target': 'http://localhost:8080',
},
},
},
},
'java': {
'version': 11,
},
'zfs': {
'pools': {
'tank': {
'devices': [
'/dev/disk/by-id/mmc-SE32G_0x1766be0d-part3',
],
},
},
},
},
}

View file

@ -130,17 +130,6 @@
'version': '1.5-rc',
'installer': True,
},
'users': {
'root': {
'authorized_users': {
'root@home.server',
'root@home.openhab3',
},
'authorized_keys': {
'ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHMKTJLw6Cb+MLt+9JFOkuo2QBpuA8EoTKOFpb3IFQHEq19YLMzOhcErWmzaRfiCnILhnwTQz0njS+n9Qu4aghk= root@mail.sublimity.de'
},
},
},
'vm': {
'cores': 2,
'ram': 8096,