summaryrefslogtreecommitdiffstats
path: root/bootstrap
blob: f7de61ce270ad655a88da2dcfb2f147535f9c5a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
set -eux
set -o pipefail

host="$1"

if ssh root@$host test ! -e /usr/bin/pacman; then
    ssh root@$host wget https://raw.githubusercontent.com/gh2o/digitalocean-debian-to-arch/debian9/install.sh -O install.sh
    echo "wipe this droplet" | ssh root@host bash install.sh
    sleep 15
fi

ssh root@$host pacman --noconfirm --needed -S puppet git

if ssh root@$host test -d /tmp/bootstrap-tozt; then
    ssh root@$host "cd /tmp/bootstrap-tozt && git pull"
else
    ssh root@$host "cd /tmp && git clone git://github.com/doy/bootstrap-tozt"
fi

ssh root@$host "cd /tmp/bootstrap-tozt && puppet apply --modulepath=./modules manifest.pp"