Skip to content

Commit

Permalink
Simplify ssh config and use it everywhere (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertvolkmann authored Oct 26, 2024
1 parent da56d8c commit e607f94
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ up: env control-plane-bake partition-bake
# without restarting the metal-core
# TODO: should be investigated and fixed if possible
sleep 10
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o "PubkeyAcceptedKeyTypes +ssh-rsa" root@leaf01 -i files/ssh/id_rsa 'systemctl restart metal-core'
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o "PubkeyAcceptedKeyTypes +ssh-rsa" root@leaf02 -i files/ssh/id_rsa 'systemctl restart metal-core'
ssh -F files/ssh/config leaf01 'systemctl restart metal-core'
ssh -F files/ssh/config leaf02 'systemctl restart metal-core'

.PHONY: restart
restart: down up
Expand Down Expand Up @@ -160,11 +160,11 @@ docker-leaf02:

.PHONY: ssh-leaf01
ssh-leaf01:
ssh -o StrictHostKeyChecking=no -o "PubkeyAcceptedKeyTypes +ssh-rsa" -i files/ssh/id_rsa root@leaf01
ssh -F files/ssh/config leaf01

.PHONY: ssh-leaf02
ssh-leaf02:
ssh -o StrictHostKeyChecking=no -o "PubkeyAcceptedKeyTypes +ssh-rsa" -i files/ssh/id_rsa root@leaf02
ssh -F files/ssh/config leaf02

## MACHINE MANAGEMENT ##

Expand Down
13 changes: 5 additions & 8 deletions files/ssh/config
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
Host leaf01
HostName leaf01
Host leaf*
User root
IdentityFile files/ssh/id_rsa
PasswordAuthentication no
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
PubkeyAcceptedKeyTypes +ssh-rsa

Host * !leaf01
Host *
User metal
IdentityFile files/ssh/id_rsa
PasswordAuthentication no
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
PubkeyAcceptedKeyTypes +ssh-rsa

Host fe80::*
# bash could be replaced with ncat, but it is not preinstalled on Cumulus
ProxyCommand ssh -q -F files/ssh/config leaf01 'sudo ip vrf exec default bash -c "exec 3<>/dev/tcp/%h/%p; cat<&0 >&3 & cat<&3 >&1"'
2 changes: 1 addition & 1 deletion test/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ echo "Test connectivity to outside"
make connect-to-www

echo "Test connectivity from outside"
ssh -o StrictHostKeyChecking=no -o "PubkeyAcceptedKeyTypes +ssh-rsa" -i files/ssh/id_rsa metal@203.0.113.130 -C exit
ssh -F files/ssh/config 203.0.113.130 -C exit

echo "Successfully started mini-lab"

0 comments on commit e607f94

Please sign in to comment.