]> git.friedersdorff.com Git - max/saltfiles.git/blob - bootstrap.sh
9cad37c2ee204ebd254b81759284944a6c6ece4e
[max/saltfiles.git] / bootstrap.sh
1 #!/bin/sh
2
3 SALT_CMD="salt-call"
4
5 install_salt() {
6         booststrap=${mktemp}
7         curl -L https://bootstrap.saltstack.com -o "${bootstrap}"
8         sudo sh "${bootstrap}" -P
9 }
10
11 if ! which $SALT_CMD; then
12         install_salt
13 fi
14
15 if [[ ! $1 ]]; then
16         sudo $SALT_CMD \
17                 --local \
18                 --config=./ \
19                 --state_verbose=True \
20                 --state-output=mixed \
21                 --log-level=quiet \
22                 --retcode-passthrough state.highstate
23 else
24         sudo $SALT_CMD \
25                 --local \
26                 --config=./ \
27                 --state_verbose=True \
28                 --state-output=mixed \
29                 --log-level=quiet \
30                 --retcode-passthrough state.sls $1
31 fi