bundles/backup-{client,server}: introduce

This commit is contained in:
Franzi 2020-11-13 12:36:52 +01:00
parent 59c1cb8551
commit f71653e3ce
Signed by: kunsi
GPG key ID: 12E3D2136B818350
23 changed files with 171 additions and 0 deletions

View file

@ -0,0 +1,25 @@
from os.path import join
if node.metadata['backups'].get('exclude_from_backups', False):
files = {
'/etc/backup.priv': {
'delete': True,
},
}
else:
files = {
'/usr/local/bin/generate-backup': {
'content_type': 'mako',
'context': {
'username': node.metadata['backup-client']['user-name'],
'server': node.metadata['backup-client']['server'],
'paths': node.metadata.get('backups', {}).get('paths', {}),
},
'mode': '0700',
},
'/etc/backup.priv': {
'content': repo.vault.decrypt_file(join('backup', 'keys', f'{node.name}.key.vault')),
'mode': '0400',
},
}