From a3c7acc3995eba950f3f8ebbbe5e4da7faeb8926 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Thu, 23 Jun 2022 02:52:18 +0200 Subject: [PATCH] influx on ssd --- bundles/influxdb2/items.py | 2 +- bundles/influxdb2/metadata.py | 29 ++++++++++++++++++++--------- bundles/postgresql/metadata.py | 3 --- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/bundles/influxdb2/items.py b/bundles/influxdb2/items.py index 525a67c..aed2d2d 100644 --- a/bundles/influxdb2/items.py +++ b/bundles/influxdb2/items.py @@ -5,7 +5,7 @@ directories['/var/lib/influxdb'] = { 'owner': 'influxdb', 'group': 'influxdb', 'needs': [ - 'zfs_dataset:tank/influxdb', + f"zfs_dataset:{node.metadata.get('zfs/storage_classes/ssd')}/influxdb", ], } diff --git a/bundles/influxdb2/metadata.py b/bundles/influxdb2/metadata.py index d2fcff7..c279c1d 100644 --- a/bundles/influxdb2/metadata.py +++ b/bundles/influxdb2/metadata.py @@ -22,15 +22,6 @@ defaults = { 'http-bind-address': ':8200', }, }, - 'zfs': { - 'datasets': { - 'tank/influxdb': { - 'mountpoint': '/var/lib/influxdb', - 'recordsize': '8192', - 'atime': 'off', - }, - }, - }, } @metadata_reactor.provides( @@ -46,6 +37,26 @@ def admin_password(metadata): } +@metadata_reactor.provides( + 'zfs/datasets', +) +def zfs(metadata): + if not node.has_bundle('zfs'): + return {} + + return { + 'zfs': { + 'datasets': { + f"{metadata.get('zfs/storage_classes/ssd')}/influxdb": { + 'mountpoint': '/var/lib/influxdb', + 'recordsize': '8192', + 'atime': 'off', + }, + }, + }, + } + + @metadata_reactor.provides( 'dns', ) diff --git a/bundles/postgresql/metadata.py b/bundles/postgresql/metadata.py index b5191bc..fef64cf 100644 --- a/bundles/postgresql/metadata.py +++ b/bundles/postgresql/metadata.py @@ -1,6 +1,3 @@ -from importlib.metadata import metadata - - root_password = repo.vault.password_for(f'{node.name} postgresql root') defaults = {