Skip to content

Commit e607f94

Browse files
Simplify ssh config and use it everywhere (#185)
1 parent da56d8c commit e607f94

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ up: env control-plane-bake partition-bake
5454
# without restarting the metal-core
5555
# TODO: should be investigated and fixed if possible
5656
sleep 10
57-
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o "PubkeyAcceptedKeyTypes +ssh-rsa" root@leaf01 -i files/ssh/id_rsa 'systemctl restart metal-core'
58-
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o "PubkeyAcceptedKeyTypes +ssh-rsa" root@leaf02 -i files/ssh/id_rsa 'systemctl restart metal-core'
57+
ssh -F files/ssh/config leaf01 'systemctl restart metal-core'
58+
ssh -F files/ssh/config leaf02 'systemctl restart metal-core'
5959

6060
.PHONY: restart
6161
restart: down up
@@ -160,11 +160,11 @@ docker-leaf02:
160160

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

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

169169
## MACHINE MANAGEMENT ##
170170

files/ssh/config

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
Host leaf01
2-
HostName leaf01
1+
Host leaf*
32
User root
4-
IdentityFile files/ssh/id_rsa
5-
PasswordAuthentication no
6-
StrictHostKeyChecking no
7-
UserKnownHostsFile /dev/null
8-
PubkeyAcceptedKeyTypes +ssh-rsa
93

10-
Host * !leaf01
4+
Host *
115
User metal
126
IdentityFile files/ssh/id_rsa
137
PasswordAuthentication no
148
StrictHostKeyChecking no
159
UserKnownHostsFile /dev/null
10+
PubkeyAcceptedKeyTypes +ssh-rsa
11+
12+
Host fe80::*
1613
# bash could be replaced with ncat, but it is not preinstalled on Cumulus
1714
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"'

test/integration.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ echo "Test connectivity to outside"
4646
make connect-to-www
4747

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

5151
echo "Successfully started mini-lab"

0 commit comments

Comments
 (0)