X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=bootstrap.sh;fp=bootstrap.sh;h=9cad37c2ee204ebd254b81759284944a6c6ece4e;hb=acdc15c5fda9fbd45371d60fb2770ff126a4d5f0;hp=0000000000000000000000000000000000000000;hpb=5377a1099e645f03005309e564829fd59cfb5861;p=max%2Fsaltfiles.git diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100644 index 0000000..9cad37c --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SALT_CMD="salt-call" + +install_salt() { + booststrap=${mktemp} + curl -L https://bootstrap.saltstack.com -o "${bootstrap}" + sudo sh "${bootstrap}" -P +} + +if ! which $SALT_CMD; then + install_salt +fi + +if [[ ! $1 ]]; then + sudo $SALT_CMD \ + --local \ + --config=./ \ + --state_verbose=True \ + --state-output=mixed \ + --log-level=quiet \ + --retcode-passthrough state.highstate +else + sudo $SALT_CMD \ + --local \ + --config=./ \ + --state_verbose=True \ + --state-output=mixed \ + --log-level=quiet \ + --retcode-passthrough state.sls $1 +fi