bundles/backup-server: fix dependencies
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-08-01 07:57:48 +02:00
parent e596b45344
commit 58d2576ec9
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -2,6 +2,8 @@ repo.libs.tools.require_bundle(node, 'zfs')
from os.path import join from os.path import join
dataset = node.metadata.get('backup-server/zfs-base')
for nodename, config in node.metadata.get('backup-server/clients', {}).items(): for nodename, config in node.metadata.get('backup-server/clients', {}).items():
with open(join(repo.path, 'data', 'backup', 'keys', f'{nodename}.pub'), 'r') as f: with open(join(repo.path, 'data', 'backup', 'keys', f'{nodename}.pub'), 'r') as f:
pubkey = f.read().strip() pubkey = f.read().strip()
@ -14,9 +16,15 @@ for nodename, config in node.metadata.get('backup-server/clients', {}).items():
'content': pubkey, 'content': pubkey,
'owner': config['user'], 'owner': config['user'],
'mode': '0400', 'mode': '0400',
'needs': {
f'zfs_dataset:{dataset}/{nodename}',
},
} }
directories[f'/srv/backups/{nodename}/backups'] = { directories[f'/srv/backups/{nodename}/backups'] = {
'owner': config['user'], 'owner': config['user'],
'mode': '0700', 'mode': '0700',
'needs': {
f'zfs_dataset:{dataset}/{nodename}',
},
} }