build up the ssh_config file based on nodes/list.yml

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 63d5fa7e
HashKnownHosts no
Host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p
Host bpi0-armhf-rb.debian.net
Port 2222
Host hb0-armhf-rb.debian.net
Port 2224
Host wbq0-armhf-rb.debian.net
Port 2225
Host cbxi4pro0-armhf-rb.debian.net
Port 2226
Host cbxi4a-armhf-rb.debian.net
Port 2239
Host cbxi4b-armhf-rb.debian.net
Port 2240
Host cb3a-armhf-rb.debian.net
Port 2244
Host odxu4a-armhf-rb.debian.net
Port 2229
Host wbd0-armhf-rb.debian.net
Port 2223
Host rpi2b-armhf-rb.debian.net
Port 2230
Host rpi2c-armhf-rb.debian.net
Port 2235
Host odxu4b-armhf-rb.debian.net
Port 2232
Host odxu4c-armhf-rb.debian.net
Port 2233
Host ff2a-armhf-rb.debian.net
Port 2234
Host ff2b-armhf-rb.debian.net
Port 2237
Host ff4a-armhf-rb.debian.net
Port 2241
Host bbx15-armhf-rb.debian.net
Port 2242
Host opi2a-armhf-rb.debian.net
Port 2236
Host opi2b-armhf-rb.debian.net
Port 2238
Host jtk1a-armhf-rb.debian.net
Port 2246
Host jtk1b-armhf-rb.debian.net
Port 2252
Host opi2c-armhf-rb.debian.net
Port 2245
Host odu3a-armhf-rb.debian.net
Port 2243
Host p64b-armhf-rb.debian.net
Port 2247
Host p64c-armhf-rb.debian.net
Port 2248
Host ff64a-armhf-rb.debian.net
Port 2250
Host jtx1a-armhf-rb.debian.net
Port 2249
Host jtx1b-armhf-rb.debian.net
Port 2253
Host jtx1c-armhf-rb.debian.net
Port 2254
Host odc2a-armhf-rb.debian.net
Port 2251
Host osuosl-build167-amd64.debian.net
Port 45046
Host osuosl-build168-amd64.debian.net
Port 45047
Host osuosl-build169-amd64.debian.net
Port 45048
Host osuosl-build170-amd64.debian.net
Port 45049
Host osuosl-build171-amd64.debian.net
Port 45050
Host osuosl-build172-amd64.debian.net
Port 45051
Host osuosl-build173-amd64.debian.net
Port 45052
Host osuosl-build174-amd64.debian.net
Port 45053
Host codethink-sled9-arm64.debian.net
Port 10109
Host codethink-sled10-arm64.debian.net
Port 10110
Host codethink-sled11-arm64.debian.net
Port 10111
Host codethink-sled12-arm64.debian.net
Port 10112
Host codethink-sled13-arm64.debian.net
Port 10113
Host codethink-sled14-arm64.debian.net
Port 10114
Host codethink-sled15-arm64.debian.net
Port 10115
Host codethink-sled16-arm64.debian.net
Port 10116
Host *
HashKnownHosts no
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p
# update_jdn will append here host specific instructions
#! /usr/bin/python3
import os
import sys
import yaml
with open('list.yml') as f:
with open(os.path.join(os.path.dirname(__file__), 'list.yml')) as f:
data = yaml.load(f)
......
#! /usr/bin/python3
import os
import yaml
with open(os.path.join(os.path.dirname(__file__), 'list.yml')) as f:
data = yaml.load(f)
for host in data:
try:
port = host['port']
except KeyError:
# port not defined; no need to write this paragraph
continue
print('Host', host['hostname'])
print(' Port', port)
......@@ -621,7 +621,8 @@ if [ "$HOSTNAME" = "jenkins" ] ; then
else
sudo cp jenkins-nodes-home/authorized_keys /var/lib/jenkins/.ssh/authorized_keys
fi
sudo -u jenkins cp jenkins-home/ssh_config /var/lib/jenkins/.ssh/config
sudo -u jenkins cp jenkins-home/ssh_config.in /var/lib/jenkins/.ssh/config
nodes/gen_ssh_config | sudo -u jenkins tee -a /var/lib/jenkins/.ssh/config > /dev/null
explain "scripts and configurations for jenkins updated."
if [ "$HOSTNAME" = "jenkins" ] ; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment