bundles/backup-{client,server}: use node names, only deploy users to correct backup server
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit
This commit is contained in:
parent
05aa78c254
commit
3e0269ba99
5 changed files with 20 additions and 11 deletions
|
@ -22,22 +22,19 @@ if node.metadata.get('backups/exclude_from_backups', False):
|
|||
'delete': True,
|
||||
}
|
||||
else:
|
||||
if ':' in node.metadata['backup-client']['server']:
|
||||
server, port = node.metadata['backup-client']['server'].split(':')
|
||||
else:
|
||||
server = node.metadata['backup-client']['server']
|
||||
port = 22
|
||||
backup_target = repo.get_node(node.metadata.get('backup-client/target'))
|
||||
|
||||
files['/usr/local/bin/generate-backup'] = {
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'username': node.metadata['backup-client']['user-name'],
|
||||
'server': server,
|
||||
'port': port,
|
||||
'server': backup_target.metadata.get('backup-server/my_hostname'),
|
||||
'port': backup_target.metadata.get('backup-server/my_ssh_port'),
|
||||
'paths': backup_paths,
|
||||
},
|
||||
'mode': '0700',
|
||||
}
|
||||
|
||||
files['/etc/backup.priv'] = {
|
||||
'content': repo.vault.decrypt_file(join('backup', 'keys', f'{node.name}.key.vault')),
|
||||
'mode': '0400',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue