From ac4dc3297a2468b4e499759860c71af0f6e2e82c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 13 Nov 2018 01:58:41 -0500 Subject: add config for my local fileserver --- bin/helpers/launch-partofme | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 bin/helpers/launch-partofme (limited to 'bin/helpers') diff --git a/bin/helpers/launch-partofme b/bin/helpers/launch-partofme new file mode 100644 index 0000000..7d4ae99 --- /dev/null +++ b/bin/helpers/launch-partofme @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -eu +set -o pipefail + +host="${1:-partofme}" +conf_location="/usr/local/share/puppet-tozt" +conf_repo="git://github.com/doy/puppet-tozt" + +remote() { + # shellcheck disable=SC2029 + ssh root@"$host" "$@" +} + +if remote test -d "$conf_location"; then + remote "cd '$conf_location' && git pull" +else + remote "mkdir -p '$conf_location'" + remote "cd '$conf_location' && git clone '$conf_repo' ." +fi +remote "cd '$conf_location' && git submodule update --init --recursive" + +scp -r /mnt/puppet/tozt/ root@"$host":/usr/local/share/puppet-tozt/modules/secret/files +remote "cd '$conf_location' && puppet apply --modulepath=./modules manifests" + +echo "Done" -- cgit v1.2.3-54-g00ecf