Removing the confusing SWARM_MODE variable
The SWARM_MODE variable is for determining whether to set the cluster_store options of docker daemon. Therefore, change it to DOCKER_CLUSTER_STORE to make it clear. Change-Id: I79f00c7cc158d825627ce6a9d28b053b0cf3c076
This commit is contained in:
parent
a6365b0570
commit
d9cbc6c325
|
@ -4,7 +4,6 @@
|
||||||
#
|
#
|
||||||
# - functions
|
# - functions
|
||||||
# - ``STACK_USER`` must be defined
|
# - ``STACK_USER`` must be defined
|
||||||
# - ``ETCD_PORT`` must be defined if on swarm mode
|
|
||||||
|
|
||||||
# stack.sh
|
# stack.sh
|
||||||
# ---------
|
# ---------
|
||||||
|
@ -24,7 +23,7 @@ set +o xtrace
|
||||||
|
|
||||||
DOCKER_ENGINE_SOCKET_FILE=${DOCKER_ENGINE_SOCKET_FILE:-/var/run/docker.sock}
|
DOCKER_ENGINE_SOCKET_FILE=${DOCKER_ENGINE_SOCKET_FILE:-/var/run/docker.sock}
|
||||||
DOCKER_ENGINE_PORT=${DOCKER_ENGINE_PORT:-2375}
|
DOCKER_ENGINE_PORT=${DOCKER_ENGINE_PORT:-2375}
|
||||||
SWARM_MODE=$(trueorfalse False SWARM_MODE)
|
DOCKER_CLUSTER_STORE=${DOCKER_CLUSTER_STORE:-}
|
||||||
|
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
|
@ -75,8 +74,8 @@ function configure_docker {
|
||||||
sudo systemctl stop docker.service || true
|
sudo systemctl stop docker.service || true
|
||||||
|
|
||||||
local cluster_store_opts=""
|
local cluster_store_opts=""
|
||||||
if [[ "$SWARM_MODE" = "True" ]]; then
|
if [[ -n "$DOCKER_CLUSTER_STORE" ]]; then
|
||||||
cluster_store_opts+="\"cluster-store\": \"etcd://localhost:$ETCD_PORT\","
|
cluster_store_opts+="\"cluster-store\": \"$DOCKER_CLUSTER_STORE\","
|
||||||
fi
|
fi
|
||||||
local docker_config_file=/etc/docker/daemon.json
|
local docker_config_file=/etc/docker/daemon.json
|
||||||
sudo mkdir -p $(dirname ${docker_config_file})
|
sudo mkdir -p $(dirname ${docker_config_file})
|
||||||
|
|
Loading…
Reference in New Issue