diff options
author | Jesse Luehrs <doy@tozt.net> | 2017-11-05 00:51:19 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2017-11-05 00:51:19 -0400 |
commit | 28a3854ee0967b499fae4a926af55781d0aa0271 (patch) | |
tree | 60e8ddc2f7b404325f1f4489787db9c0f72fd103 /bootstrap | |
parent | 80f62b92f7f93246bdbb56ff4bbdf19ff321d814 (diff) | |
download | puppet-tozt-28a3854ee0967b499fae4a926af55781d0aa0271.tar.gz puppet-tozt-28a3854ee0967b499fae4a926af55781d0aa0271.zip |
simplify
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 28 |
1 files changed, 16 insertions, 12 deletions
@@ -4,22 +4,26 @@ set -o pipefail host="$1" -if ssh root@$host test ! -e /usr/bin/pacman; then - ssh root@$host apt-get -y update - ssh root@$host apt-get -y install git - ssh root@$host "cd /tmp && git clone git://github.com/doy/bootstrap-tozt" - ssh root@$host "cd /tmp/bootstrap-tozt && git submodule update --init" - ssh root@$host "cd /tmp/bootstrap-tozt/digitalocean-debian-to-arch && bash install.sh --i_understand_that_this_droplet_will_be_completely_wiped" +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" sleep 30 fi -ssh root@$host pacman --noconfirm -Sy -ssh root@$host pacman --noconfirm --needed -S puppet git ruby-shadow +remote pacman --noconfirm -Sy +remote pacman --noconfirm --needed -S puppet git ruby-shadow -if ssh root@$host test -d /tmp/bootstrap-tozt; then - ssh root@$host "cd /tmp/bootstrap-tozt && git pull" +if remote test -d /tmp/bootstrap-tozt; then + remote "cd /tmp/bootstrap-tozt && git pull" else - ssh root@$host "cd /tmp && git clone git://github.com/doy/bootstrap-tozt" + remote "cd /tmp && git clone git://github.com/doy/bootstrap-tozt" fi -ssh root@$host "cd /tmp/bootstrap-tozt && puppet apply --modulepath=./modules manifest.pp" +remote "cd /tmp/bootstrap-tozt && puppet apply --modulepath=./modules manifest.pp" |