Browse code

Merge "Allow overrides for ETCD ports"

Zuul authored on 2018/03/11 14:43:44
Showing 3 changed files
... ...
@@ -326,7 +326,7 @@ function configure_cinder {
326 326
     if [[ ! -z "$CINDER_COORDINATION_URL" ]]; then
327 327
         iniset $CINDER_CONF coordination backend_url "$CINDER_COORDINATION_URL"
328 328
     elif is_service_enabled etcd3; then
329
-        iniset $CINDER_CONF coordination backend_url "etcd3+http://${SERVICE_HOST}:2379"
329
+        iniset $CINDER_CONF coordination backend_url "etcd3+http://${SERVICE_HOST}:$ETCD_PORT"
330 330
     fi
331 331
 }
332 332
 
... ...
@@ -27,7 +27,6 @@ set +o xtrace
27 27
 ETCD_DATA_DIR="$DATA_DIR/etcd"
28 28
 ETCD_SYSTEMD_SERVICE="devstack@etcd.service"
29 29
 ETCD_BIN_DIR="$DEST/bin"
30
-ETCD_PORT=2379
31 30
 
32 31
 if is_ubuntu ; then
33 32
     UBUNTU_RELEASE_BASE_NUM=`lsb_release -r | awk '{print $2}' | cut -d '.' -f 1`
... ...
@@ -38,13 +37,13 @@ function start_etcd3 {
38 38
     local cmd="$ETCD_BIN_DIR/etcd"
39 39
     cmd+=" --name $HOSTNAME --data-dir $ETCD_DATA_DIR"
40 40
     cmd+=" --initial-cluster-state new --initial-cluster-token etcd-cluster-01"
41
-    cmd+=" --initial-cluster $HOSTNAME=http://$SERVICE_HOST:2380"
42
-    cmd+=" --initial-advertise-peer-urls http://$SERVICE_HOST:2380"
41
+    cmd+=" --initial-cluster $HOSTNAME=http://$SERVICE_HOST:$ETCD_PEER_PORT"
42
+    cmd+=" --initial-advertise-peer-urls http://$SERVICE_HOST:$ETCD_PEER_PORT"
43 43
     cmd+=" --advertise-client-urls http://$SERVICE_HOST:$ETCD_PORT"
44 44
     if [ "$SERVICE_LISTEN_ADDRESS" == "::" ]; then
45
-        cmd+=" --listen-peer-urls http://[::]:2380 "
45
+        cmd+=" --listen-peer-urls http://[::]:$ETCD_PEER_PORT "
46 46
     else
47
-        cmd+=" --listen-peer-urls http://0.0.0.0:2380 "
47
+        cmd+=" --listen-peer-urls http://0.0.0.0:$ETCD_PEER_PORT "
48 48
     fi
49 49
     cmd+=" --listen-client-urls http://$SERVICE_HOST:$ETCD_PORT"
50 50
 
... ...
@@ -766,6 +766,8 @@ elif is_arch "s390x"; then
766 766
 else
767 767
     exit_distro_not_supported "invalid hardware type - $ETCD_ARCH"
768 768
 fi
769
+ETCD_PORT=${ETCD_PORT:-2379}
770
+ETCD_PEER_PORT=${ETCD_PEER_PORT:-2380}
769 771
 ETCD_DOWNLOAD_URL=${ETCD_DOWNLOAD_URL:-https://github.com/coreos/etcd/releases/download}
770 772
 ETCD_NAME=etcd-$ETCD_VERSION-linux-$ETCD_ARCH
771 773
 ETCD_DOWNLOAD_FILE=$ETCD_NAME.tar.gz