Mercurial > hg > cc > azure
changeset 4:56d8823c68e0
pretty much complete...
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Fri, 28 Sep 2018 15:18:07 +0000 |
parents | be5de30147ab |
children | 580221a17890 |
files | master/bin/makeWorker.sh master/bin/setupTemplate.sh workers/bin/installInTemplate.sh workers/bin/setupTemplate.sh |
diffstat | 4 files changed, 17 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/master/bin/makeWorker.sh Fri Sep 28 12:29:29 2018 +0000 +++ b/master/bin/makeWorker.sh Fri Sep 28 15:18:07 2018 +0000 @@ -5,7 +5,4 @@ ip=$(az vm list-ip-addresses -g cc -n $name|egrep -o '"ipAddress": ".*"' | cut -f 2 -d ' ' | tr -d \") export $name=$ip echo $name=$ip -ssh -o StrictHostKeyChecking=no $ip <cat /var/cc/workers/bin/setupTemplate.sh -sudo bash -c "cd ~cc/.ssh && tar -czf - authorized_keys id_rsa id_rsa.pub" | \ - ssh $ip "sudo su -c 'cd ~/.ssh && tar -xzf -' cd" - +setupTemplate.sh $ip
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/master/bin/setupTemplate.sh Fri Sep 28 15:18:07 2018 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/bash +ip=$1 +ssh -o StrictHostKeyChecking=no $ip </var/cc/workers/bin/setupTemplate.sh +ssh $ip "sudo su -c 'cd ~/.ssh && cat >authorized_keys' cc" < /var/cc/ak +ssh $ip </var/cc/workers/bin/installInTemplate.sh | tee /dev/stderr | tail -1 | sudo tee -a ~cc/.ssh/authorized_keys >/dev/null +( cd ~ && tar -czf - .azure ) | ssh cc@$ip "tar -xzf -"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/workers/bin/installInTemplate.sh Fri Sep 28 15:18:07 2018 +0000 @@ -0,0 +1,9 @@ +#!/usr/bin/bash +sudo apt-get -y install python3 parallel psmisc jq mercurial curl +curl -L https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - +echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ jessie main" |\ + sudo tee /etc/apt/sources.list.d/azure-cli.list +sudo apt-get -y --force-yes install apt-transport-https +sudo apt-get -y update +sudo apt-get -y install azure-cli +sudo cat ~cc/.ssh/id_rsa.pub
--- a/workers/bin/setupTemplate.sh Fri Sep 28 12:29:29 2018 +0000 +++ b/workers/bin/setupTemplate.sh Fri Sep 28 15:18:07 2018 +0000 @@ -2,9 +2,7 @@ sudo adduser --disabled-password --GECOS "CC worker" cc sudo su cc cd ~cc -mkdir .ssh -chmod og-rw .ssh -cd .ssh +ssh-keygen -P "" -q -t rsa -f /home/cc/.ssh/id_rsa