Newer
Older
GITPROJ=https://chaos.expert/ccc-ffm/4Refugees-InternetCafe
ATHQ=false
HQSERVER="install.hq"
PROXYURL="http://${HQSERVER}:8080/"
#pull myself from git repo
wget "${GITPROJ}/raw/master/bootstrap.sh" -O /root/bootstrap.sh
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
if [ ! -e /etc/puppet/.git ]; then
mv /etc/puppet /etc/puppet.orig
git clone ${GITPROJ}.git /etc/puppet
fi
git remote set-url origin ${GITPROJ}.git
git submodule init
git submodule update
puppet apply /etc/puppet/manifests/site.pp
curl -T /tmp/facts.yaml ftp://${HQSERVER}/refugee-notebooks/${HOSTNAME}.yaml
fi