diff options
author | Clément Delafargue <39330590+clementd-fretlink@users.noreply.github.com> | 2020-06-22 14:53:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-22 14:53:42 +0200 |
commit | fcb00fd5cc86db70d122e126f52e24d0eba4af96 (patch) | |
tree | 93dee19980af622d21d08039aec2248e61bff186 /files/clever-set-scalability.sh | |
parent | f39118d499132f017d7f2ec0944bf673b6deb7e9 (diff) | |
parent | 791d2dcbcb3d90ea66ce9b6b519eeb576f5f601b (diff) | |
download | ansible-clever-fcb00fd5cc86db70d122e126f52e24d0eba4af96.tar.gz ansible-clever-fcb00fd5cc86db70d122e126f52e24d0eba4af96.tar.zst ansible-clever-fcb00fd5cc86db70d122e126f52e24d0eba4af96.zip |
Merge pull request #67 from clementd-fretlink/scaling
scalability configuration
Diffstat (limited to 'files/clever-set-scalability.sh')
-rwxr-xr-x | files/clever-set-scalability.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/files/clever-set-scalability.sh b/files/clever-set-scalability.sh new file mode 100755 index 0000000..34a5a24 --- /dev/null +++ b/files/clever-set-scalability.sh | |||
@@ -0,0 +1,19 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | set -eo pipefail | ||
4 | params=() | ||
5 | if [ -n "$INSTANCES" ]; then | ||
6 | params+=("--instances" "${INSTANCES}") | ||
7 | elif [ -n "$MIN_INSTANCES" ] && [ -n "$MAX_INSTANCES" ]; then | ||
8 | params+=("--min-instances" "${MIN_INSTANCES}") | ||
9 | params+=("--max-instances" "${MAX_INSTANCES}") | ||
10 | |||
11 | fi | ||
12 | if [ -n "$FLAVOR" ]; then | ||
13 | params+=("--flavor" "${FLAVOR}") | ||
14 | elif [ -n "$MIN_FLAVOR" ] && [ -n "$MAX_FLAVOR" ]; then | ||
15 | params+=("--min-flavor" "${MIN_FLAVOR}") | ||
16 | params+=("--max-flavor" "${MAX_FLAVOR}") | ||
17 | fi | ||
18 | |||
19 | clever scale "${params[@]}" | ||