diff options
author | Jesse Luehrs <doy@tozt.net> | 2018-11-13 01:58:41 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2018-11-13 01:58:41 -0500 |
commit | ac4dc3297a2468b4e499759860c71af0f6e2e82c (patch) | |
tree | fa485ced884b21bdc8fdf77f4e85f72939cf2c6e /bin/helpers | |
parent | 1643a8a76b0a834a97decbecbcbd6eac19430aa1 (diff) | |
download | puppet-tozt-ac4dc3297a2468b4e499759860c71af0f6e2e82c.tar.gz puppet-tozt-ac4dc3297a2468b4e499759860c71af0f6e2e82c.zip |
add config for my local fileserver
Diffstat (limited to 'bin/helpers')
-rw-r--r-- | bin/helpers/launch-partofme | 25 |
1 files changed, 25 insertions, 0 deletions
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" |