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
|
@ -1,4 +1,7 @@
|
|||
defaults = {
|
||||
'backup-server': {
|
||||
'my_ssh_port': 22,
|
||||
},
|
||||
'openssh': {
|
||||
'allowed_users': {
|
||||
# Usernames for backup clients always start with 'c-'
|
||||
|
@ -9,6 +12,7 @@ defaults = {
|
|||
|
||||
@metadata_reactor.provides(
|
||||
'backup-server/clients',
|
||||
'backup-server/my_hostname',
|
||||
)
|
||||
def get_my_clients(metadata):
|
||||
my_clients = {}
|
||||
|
@ -17,6 +21,9 @@ def get_my_clients(metadata):
|
|||
if not rnode.has_bundle('backup-client') or rnode.metadata.get('backups/exclude_from_backups', False):
|
||||
continue
|
||||
|
||||
if node.name != rnode.metadata.get('backup-client/target'):
|
||||
continue
|
||||
|
||||
my_clients[rnode.name] = {
|
||||
'user': rnode.metadata.get('backup-client/user-name'),
|
||||
}
|
||||
|
@ -24,6 +31,7 @@ def get_my_clients(metadata):
|
|||
return {
|
||||
'backup-server': {
|
||||
'clients': my_clients,
|
||||
'my_hostname': metadata.get('hostname'),
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue