Skip to content

Commit b0a08c1

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Make etcd3 setup work with IPv6 addresses"
2 parents b0bd582 + 146332e commit b0a08c1

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

lib/etcd3

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,13 @@ function start_etcd3 {
4040
cmd+=" --initial-cluster-state new --initial-cluster-token etcd-cluster-01"
4141
cmd+=" --initial-cluster $HOSTNAME=http://$SERVICE_HOST:2380"
4242
cmd+=" --initial-advertise-peer-urls http://$SERVICE_HOST:2380"
43-
cmd+=" --advertise-client-urls http://${HOST_IP}:$ETCD_PORT"
44-
cmd+=" --listen-peer-urls http://0.0.0.0:2380 "
45-
cmd+=" --listen-client-urls http://${HOST_IP}:$ETCD_PORT"
43+
cmd+=" --advertise-client-urls http://$SERVICE_HOST:$ETCD_PORT"
44+
if [ "$SERVICE_LISTEN_ADDRESS" == "::" ]; then
45+
cmd+=" --listen-peer-urls http://[::]:2380 "
46+
else
47+
cmd+=" --listen-peer-urls http://0.0.0.0:2380 "
48+
fi
49+
cmd+=" --listen-client-urls http://$SERVICE_HOST:$ETCD_PORT"
4650

4751
local unitfile="$SYSTEMD_DIR/$ETCD_SYSTEMD_SERVICE"
4852
write_user_unit_file $ETCD_SYSTEMD_SERVICE "$cmd" "" "root"

0 commit comments

Comments
 (0)