-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'kunsi-feature-no-default-password'
- Loading branch information
Showing
6 changed files
with
86 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
if node.metadata.get('users/voc/ssh_config_verbatim/mixer-to-encoder-ssh-login', set()): | ||
files['/home/voc/.ssh/mixer-to-encoder-ssh-login'] = { | ||
'content': repo.libs.ssh.generate_ed25519_private_key('voc', node), | ||
'owner': 'voc', | ||
'mode': '0600', | ||
} | ||
else: | ||
files['/home/voc/.ssh/mixer-to-encoder-ssh-login'] = { | ||
'delete': True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from bundlewrap.exceptions import NoSuchGroup | ||
|
||
@metadata_reactor.provides( | ||
'users/voc/ssh_config_verbatim/mixer-to-encoder-ssh-login', | ||
) | ||
def ssh_config_generator(metadata): | ||
room_number = metadata.get('room_number', None) | ||
if room_number is None: | ||
return {} | ||
|
||
try: | ||
saal_nodes = repo.nodes_in_group(f'saal{room_number}') | ||
except NoSuchGroup: | ||
return {} | ||
|
||
ssh_hostnames = set() | ||
for rnode in saal_nodes: | ||
if rnode.name == node.name: | ||
continue | ||
|
||
ssh_hostnames.add(rnode.name) | ||
ssh_hostnames.add(rnode.hostname) | ||
ssh_hostnames.add(rnode.metadata.get('hostname')) | ||
|
||
return { | ||
'users': { | ||
'voc': { | ||
'ssh_config_verbatim': { | ||
'mixer-to-encoder-ssh-login': ssh_hostnames, | ||
}, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
}, | ||
'bundles': { | ||
'mixer-common', | ||
'mixer-to-encoder-ssh-login', | ||
'voctogui', | ||
'voctomix2', | ||
}, | ||
|