multiplex_incoming: local, too

This commit is contained in:
cronekorkn 2022-09-22 16:11:25 +02:00
parent c8a916d5ac
commit 7a60ab1599
Signed by: cronekorkn
SSH key fingerprint: SHA256:v0410ZKfuO1QHdgKBsdQNF64xmTxOF8osF1LIqwTcVw
2 changed files with 3 additions and 0 deletions

View file

@ -5,7 +5,9 @@ Host *
StrictHostKeyChecking yes StrictHostKeyChecking yes
GlobalKnownHostsFile /etc/ssh/ssh_known_hosts GlobalKnownHostsFile /etc/ssh/ssh_known_hosts
% if multiplex_incoming:
Host ${' '.join(sorted(multiplex_hosts))} Host ${' '.join(sorted(multiplex_hosts))}
ControlMaster auto ControlMaster auto
ControlPath ~/.ssh/multiplex-%C ControlPath ~/.ssh/multiplex-%C
ControlPersist 5m ControlPersist 5m
% endif

View file

@ -27,6 +27,7 @@ files = {
'/etc/ssh/ssh_config': { '/etc/ssh/ssh_config': {
'content_type': 'mako', 'content_type': 'mako',
'context': { 'context': {
'multiplex_incoming': node.metadata.get('ssh/multiplex_incoming'),
'multiplex_hosts': set( 'multiplex_hosts': set(
str(ip_interface(other_node.metadata.get('network/internal/ipv4')).ip) str(ip_interface(other_node.metadata.get('network/internal/ipv4')).ip)
for other_node in repo.nodes for other_node in repo.nodes