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

host="$1"

remote() {
    ssh root@$host "$@"
}

if remote test ! -e /usr/bin/pacman; then
    remote apt-get -y update
    remote apt-get -y install git
    remote "cd /tmp && git clone git://github.com/doy/bootstrap-tozt"
    remote "cd /tmp/bootstrap-tozt && git submodule update --init"
    remote "cd /tmp/bootstrap-tozt/digitalocean-debian-to-arch && bash install.sh --i_understand_that_this_droplet_will_be_completely_wiped --extra_packages 'puppet git ruby-shadow'"
    sleep 30
fi

if remote test -d /tmp/bootstrap-tozt; then
    remote "cd /tmp/bootstrap-tozt && git pull"
else
    remote "cd /tmp && git clone git://github.com/doy/bootstrap-tozt"
fi

remote "cd /tmp/bootstrap-tozt && puppet apply --modulepath=./modules manifest.pp"