added facter facts upload and curl install
authorWonko T. Sane <42@wonko.de>
Mon, 14 Mar 2016 17:17:22 +0000 (18:17 +0100)
committerWonko T. Sane <42@wonko.de>
Mon, 14 Mar 2016 17:17:22 +0000 (18:17 +0100)
bootstrap.sh

index 9cb6e15..695500c 100755 (executable)
@@ -1,8 +1,9 @@
 #!/bin/bash -x
 
 GITPROJ=https://chaos.expert/ccc-ffm/4Refugees-InternetCafe
-
-
+ATHQ=false
+HQSERVER="install.hq"
+PROXYURL="http://${HQSERVER}:8080/"
 if [ "$1" != "RUNME" ]; then
 
     #pull myself from git repo
@@ -13,16 +14,19 @@ if [ "$1" != "RUNME" ]; then
 fi
 
 #check for install.hq
-if ping -c 5 install.hq; then
-    echo 'Acquire::http::Proxy "http://install.hq:8080/";' > /etc/apt/apt.conf
-    facter --yaml /tmp/facts.yaml
-    curl -T /tmp/facts.yaml ftp://install.hq/refugee-notebooks/${HOSTNAME}.yaml
+if ping -c 5 ${HQSERVER}; then
+    ATHQ=true
+fi
+
+
+if [ "$ATHQ" = true ]; then
+    echo 'Acquire::http::Proxy "${PROXYURL}";' > /etc/apt/apt.conf
 else
     echo "#no proxy" > /etc/apt/apt.conf
 fi
 
 apt update
-apt install git puppet vim
+apt install git puppet vim curl
 apt full-upgrade
 
 
@@ -39,3 +43,8 @@ git submodule init
 git submodule update
 git pull
 puppet apply /etc/puppet/manifests/site.pp
+
+if [ "$ATHQ" = true ]; then
+    facter --yaml /tmp/facts.yaml
+    curl -T /tmp/facts.yaml ftp://${HQSERVER}/refugee-notebooks/${HOSTNAME}.yaml
+fi