Mercurial > hg > cc > azure
changeset 14:c1c8275bd194
trying to make this work
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Thu, 18 Oct 2018 14:30:04 +0000 |
parents | bba589cab837 |
children | 68cca895e872 |
files | master/bin/makeWorker.sh master/bin/setupTemplate.sh workers/bin/installInTemplate.sh |
diffstat | 3 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/master/bin/makeWorker.sh Fri Oct 12 08:51:50 2018 +0000 +++ b/master/bin/makeWorker.sh Thu Oct 18 14:30:04 2018 +0000 @@ -3,6 +3,7 @@ # Misnamed -- it assumes you've already done # az vm create -n [name] -g cc --image Debian --size Standard_... # Source this to get the worker name set to its IP address +set -e -o pipefail name=$1 ip=$(az vm list-ip-addresses -g cc -n $name|egrep -o '"ipAddress": ".*"' | cut -f 2 -d ' ' | tr -d \") export $name=$ip
--- a/master/bin/setupTemplate.sh Fri Oct 12 08:51:50 2018 +0000 +++ b/master/bin/setupTemplate.sh Thu Oct 18 14:30:04 2018 +0000 @@ -3,5 +3,5 @@ #ssh -o StrictHostKeyChecking=no $ip </var/cc/workers/bin/setupTemplate.sh # Not necessary as will happen automatically in vmss setup if/when run from cc # ssh -o StrictHostKeyChecking=no $ip "sudo su -c 'cd ~/.ssh && cat >authorized_keys' cc" < /var/cc/ak -ssh -o StrictHostKeyChecking=no $ip </var/cc/workers/bin/installInTemplate.sh # | tee /dev/stderr | tail -1 | sudo tee -a ~cc/.ssh/authorized_keys >/dev/null +ssh -o StrictHostKeyChecking=no $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 $ip "tar -xzf -"
--- a/workers/bin/installInTemplate.sh Fri Oct 12 08:51:50 2018 +0000 +++ b/workers/bin/installInTemplate.sh Thu Oct 18 14:30:04 2018 +0000 @@ -6,4 +6,6 @@ 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 +sudo adduser --disabled-password -GECOS "CC master" cc +sudo su -c 'ssh-keygen -t rsa -N "" -f /home/cc/.ssh/id_rsa' cc +sudo cat ~cc/.ssh/id_rsa.pub