summaryrefslogtreecommitdiffstats
path: root/infest-cac-CentOS-7-64bit.sh
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-06-24 14:36:59 +0200
committertv <tv@shackspace.de>2015-06-24 15:01:23 +0200
commit45a0cb01d37e64b4d4d56a7a6769aba61d0fd8f2 (patch)
treedb07acb0a8baa7ee67460e1743461a06a87c0adc /infest-cac-CentOS-7-64bit.sh
parentbb7343cd89115e0768baaa426c68e49d399f6c6f (diff)
rewrite infest-cac-CentOS-7-64bit
Diffstat (limited to 'infest-cac-CentOS-7-64bit.sh')
-rwxr-xr-xinfest-cac-CentOS-7-64bit.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/infest-cac-CentOS-7-64bit.sh b/infest-cac-CentOS-7-64bit.sh
new file mode 100755
index 000000000..32090ae9e
--- /dev/null
+++ b/infest-cac-CentOS-7-64bit.sh
@@ -0,0 +1,33 @@
+#! /bin/sh
+set -xeuf
+
+serverspec=$1
+systemname=$2
+
+./cac poll 10s 2>/dev/null &
+pollpid=$!
+trap "kill $pollpid; trap - EXIT" EXIT
+
+./cac waitstatus $serverspec 'Powered On'
+
+# TODO don't set label/mode if they're already good
+./cac setlabel $serverspec $systemname
+./cac setmode $systemname normal
+./cac generatenetworking $systemname > modules/$systemname/networking.nix
+
+cat infest.d/cac-CentOS-7-64bit/prepare.sh | ./cac ssh $systemname \
+ nix_url=https://nixos.org/releases/nix/nix-1.9/nix-1.9-x86_64-linux.tar.bz2 \
+ nix_sha256=5c76611c631e79aef5faf3db2d253237998bbee0f61fa093f925fa32203ae32b \
+ /bin/sh
+
+./cac pushconfig $systemname /mnt
+
+# This needs to be run twice because (at least):
+# Initialized empty Git repository in /var/lib/git/$reponame
+# chown: invalid user: 'git:nogroup'
+cat infest.d/nixos-install.sh | ./cac ssh $systemname || :
+cat infest.d/nixos-install.sh | ./cac ssh $systemname
+
+cat infest.d/cac-CentOS-7-64bit/finalize.sh | ./cac ssh $systemname
+
+./cac powerop $systemname reset