aboutsummaryrefslogtreecommitdiffhomepage
path: root/files/clever-set-scalability.sh
diff options
context:
space:
mode:
authorClement Delafargue <clement.delafargue@fretlink.com>2020-06-19 15:39:22 +0200
committerClement Delafargue <clement.delafargue@fretlink.com>2020-06-22 14:41:16 +0200
commit96f02eb1f426c16c631598c80bec4bc0e60f75c1 (patch)
tree36a0cf97bdfea091f673537eef7c5465c97a657c /files/clever-set-scalability.sh
parentf39118d499132f017d7f2ec0944bf673b6deb7e9 (diff)
downloadansible-clever-96f02eb1f426c16c631598c80bec4bc0e60f75c1.tar.gz
ansible-clever-96f02eb1f426c16c631598c80bec4bc0e60f75c1.tar.zst
ansible-clever-96f02eb1f426c16c631598c80bec4bc0e60f75c1.zip
Add support for scalability configuration
Closes #52
Diffstat (limited to 'files/clever-set-scalability.sh')
-rwxr-xr-xfiles/clever-set-scalability.sh19
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
3set -eo pipefail
4params=()
5if [ -n "$INSTANCES" ]; then
6 params+=("--instances" "${INSTANCES}")
7elif [ -n "$MIN_INSTANCES" ] && [ -n "$MAX_INSTANCES" ]; then
8 params+=("--min-instances" "${MIN_INSTANCES}")
9 params+=("--max-instances" "${MAX_INSTANCES}")
10
11fi
12if [ -n "$FLAVOR" ]; then
13 params+=("--flavor" "${FLAVOR}")
14elif [ -n "$MIN_FLAVOR" ] && [ -n "$MAX_FLAVOR" ]; then
15 params+=("--min-flavor" "${MIN_FLAVOR}")
16 params+=("--max-flavor" "${MAX_FLAVOR}")
17fi
18
19clever scale "${params[@]}"