changeset 3:be5de30147ab

just barely
author Henry S. Thompson <ht@markup.co.uk>
date Fri, 28 Sep 2018 12:29:29 +0000
parents b4b731c105e2
children 56d8823c68e0
files master/bin/makeWorker.sh workers/bin/setupTemplate.sh
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/master/bin/makeWorker.sh	Fri Sep 28 12:29:29 2018 +0000
@@ -0,0 +1,11 @@
+#!/usr/bin/bash
+# Usage . makeWorker.sh name
+# Source this to get the worker name set to its IP address
+name=$1
+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"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/workers/bin/setupTemplate.sh	Fri Sep 28 12:29:29 2018 +0000
@@ -0,0 +1,10 @@
+#!/usr/bin/bash
+sudo adduser --disabled-password --GECOS "CC worker" cc
+sudo su cc
+cd ~cc
+mkdir .ssh
+chmod og-rw .ssh
+cd .ssh
+
+
+