From 92ad15251226dc8f19ad5f901c48f4eb8892f24e Mon Sep 17 00:00:00 2001 From: Rawlin Peters Date: Mon, 20 Jul 2015 13:33:33 -0600 Subject: [PATCH] Explicitly set bind_ip in Swift server config files Currently, the Swift proxy, object, account, and container servers bind to IPv4 address 0.0.0.0 by default. In the case of a user setting SERVICE_IP_VERSION=6 in their local.conf file, these Swift servers still listen on 0.0.0.0 instead of ::, which causes a ./stack.sh run to fail. This change explicitly sets the bind_ip variable in the Swift server config files so that the servers bind to either 0.0.0.0 (when SERVICE_IP_VERSION != 6) or :: (when SERVICE_IP_VERSION == 6). This patch is related to the following patch for devstack IPv6 support: https://review.openstack.org/#/c/192329 Change-Id: Ie268c6daf5374e67ef8710a731c3af50ffdb821e --- lib/swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/swift b/lib/swift index 826f233414..96d730ef2c 100644 --- a/lib/swift +++ b/lib/swift @@ -46,6 +46,7 @@ SWIFT3_DIR=$DEST/swift3 SWIFT_SERVICE_PROTOCOL=${SWIFT_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL} SWIFT_DEFAULT_BIND_PORT_INT=${SWIFT_DEFAULT_BIND_PORT_INT:-8081} SWIFT_SERVICE_LOCAL_HOST=${SWIFT_SERVICE_LOCAL_HOST:-$SERVICE_LOCAL_HOST} +SWIFT_SERVICE_LISTEN_ADDRESS=${SWIFT_SERVICE_LISTEN_ADDRESS:-$SERVICE_LISTEN_ADDRESS} # TODO: add logging to different location. @@ -361,6 +362,9 @@ function configure_swift { iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT log_level iniset ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT log_level DEBUG + iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT bind_ip + iniset ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT bind_ip ${SWIFT_SERVICE_LISTEN_ADDRESS} + iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT bind_port if is_service_enabled tls-proxy; then iniset ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT bind_port ${SWIFT_DEFAULT_BIND_PORT_INT} @@ -463,17 +467,23 @@ EOF local swift_node_config=${SWIFT_CONF_DIR}/object-server/${node_number}.conf cp ${SWIFT_DIR}/etc/object-server.conf-sample ${swift_node_config} generate_swift_config_services ${swift_node_config} ${node_number} $(( OBJECT_PORT_BASE + 10 * (node_number - 1) )) object + iniuncomment ${swift_node_config} DEFAULT bind_ip + iniset ${swift_node_config} DEFAULT bind_ip ${SWIFT_SERVICE_LISTEN_ADDRESS} iniset ${swift_node_config} filter:recon recon_cache_path ${SWIFT_DATA_DIR}/cache swift_node_config=${SWIFT_CONF_DIR}/container-server/${node_number}.conf cp ${SWIFT_DIR}/etc/container-server.conf-sample ${swift_node_config} generate_swift_config_services ${swift_node_config} ${node_number} $(( CONTAINER_PORT_BASE + 10 * (node_number - 1) )) container + iniuncomment ${swift_node_config} DEFAULT bind_ip + iniset ${swift_node_config} DEFAULT bind_ip ${SWIFT_SERVICE_LISTEN_ADDRESS} iniuncomment ${swift_node_config} app:container-server allow_versions iniset ${swift_node_config} app:container-server allow_versions "true" swift_node_config=${SWIFT_CONF_DIR}/account-server/${node_number}.conf cp ${SWIFT_DIR}/etc/account-server.conf-sample ${swift_node_config} generate_swift_config_services ${swift_node_config} ${node_number} $(( ACCOUNT_PORT_BASE + 10 * (node_number - 1) )) account + iniuncomment ${swift_node_config} DEFAULT bind_ip + iniset ${swift_node_config} DEFAULT bind_ip ${SWIFT_SERVICE_LISTEN_ADDRESS} done # Set new accounts in tempauth to match keystone tenant/user (to make testing easier)