Merge "Cleanup required variables checks for all containers"

This commit is contained in:
Jenkins 2015-02-06 19:08:46 +00:00 committed by Gerrit Code Review
commit 26b564dd06
24 changed files with 84 additions and 83 deletions

View File

@ -8,21 +8,16 @@ set -e
: ${BARBICAN_KEYSTONE_USER:=barbican} : ${BARBICAN_KEYSTONE_USER:=barbican}
: ${ADMIN_TENANT_NAME:=admin} : ${ADMIN_TENANT_NAME:=admin}
if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then
echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2
exit 1
fi
if ! [ "$DB_ROOT_PASSWORD" ]; then
echo "*** Missing DB_ROOT_PASSWORD" >&2
exit 1
fi
if ! [ "$BARBICAN_DB_PASSWORD" ]; then if ! [ "$BARBICAN_DB_PASSWORD" ]; then
BARBICAN_DB_PASSWORD=$(openssl rand -hex 15) BARBICAN_DB_PASSWORD=$(openssl rand -hex 15)
export BARBICAN_DB_PASSWORD export BARBICAN_DB_PASSWORD
fi fi
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_ADMIN_SERVICE_PORT BARBICAN_ADMIN_PASSWORD
check_for_db
check_for_keystone
mysql -h ${MARIADB_SERVICE_HOST} -u root -p"${DB_ROOT_PASSWORD}" mysql <<EOF mysql -h ${MARIADB_SERVICE_HOST} -u root -p"${DB_ROOT_PASSWORD}" mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${BARBICAN_DB_NAME}; CREATE DATABASE IF NOT EXISTS ${BARBICAN_DB_NAME};
GRANT ALL PRIVILEGES ON barbican.* TO GRANT ALL PRIVILEGES ON barbican.* TO

View File

@ -5,7 +5,12 @@ set -e
. /opt/kolla/kolla-common.sh . /opt/kolla/kolla-common.sh
. /opt/kolla/config-ceilometer.sh . /opt/kolla/config-ceilometer.sh
check_required_vars CEILOMETER_DB_USER CEILOMETER_DB_NAME KEYSTONE_AUTH_PROTOCOL CEILOMETER_KEYSTONE_USER CEILOMETER_ADMIN_PASSWORD ADMIN_TENANT_NAME METERING_SECRET CEILOMETER_API_SERVICE_HOST PUBLIC_IP check_required_vars CEILOMETER_DB_USER CEILOMETER_DB_NAME \
CEILOMETER_DB_PASSWORD KEYSTONE_ADMIN_TOKEN \
KEYSTONE_AUTH_PROTOCOL KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_ADMIN_SERVICE_PORT ADMIN_TENANT_NAME \
CEILOMETER_KEYSTONE_USER CEILOMETER_ADMIN_PASSWORD \
CEILOMETER_API_SERVICE_HOST PUBLIC_IP
check_for_keystone check_for_keystone
check_for_db check_for_db

View File

@ -10,8 +10,10 @@ set -e
: ${CEILOMETER_ADMIN_PASSWORD:=kolla} : ${CEILOMETER_ADMIN_PASSWORD:=kolla}
: ${ADMIN_TENANT_NAME:=admin} : ${ADMIN_TENANT_NAME:=admin}
: ${METERING_SECRET:=ceilometer} : ${METERING_SECRET:=ceilometer}
: ${RABBIT_PASSWORD:=guest}
check_required_vars CEILOMETER_DB_PASSWORD KEYSTONE_ADMIN_TOKEN DB_ROOT_PASSWORD check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_ADMIN_SERVICE_PORT KEYSTONE_PUBLIC_SERVICE_HOST \
dump_vars dump_vars
cat > /openrc <<EOF cat > /openrc <<EOF
@ -27,7 +29,7 @@ crudini --set $cfg \
crudini --set $cfg \ crudini --set $cfg \
DEFAULT rabbit_host ${RABBITMQ_SERVICE_HOST} DEFAULT rabbit_host ${RABBITMQ_SERVICE_HOST}
crudini --set $cfg \ crudini --set $cfg \
DEFAULT rabbit_password ${RABBITMQ_PASS} DEFAULT rabbit_password ${RABBIT_PASSWORD}
crudini --set $cfg \ crudini --set $cfg \
keystone_authtoken \ keystone_authtoken \

View File

@ -3,10 +3,10 @@
. /opt/kolla/kolla-common.sh . /opt/kolla/kolla-common.sh
. /opt/kolla/config-ceilometer.sh . /opt/kolla/config-ceilometer.sh
check_required_vars KEYSTONE_AUTH_PROTOCOL CEILOMETER_KEYSTONE_USER CEILOMETER_ADMIN_PASSWORD ADMIN_TENANT_NAME check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_AUTH_PROTOCOL \
KEYSTONE_ADMIN_SERVICE_HOST KEYSTONE_ADMIN_SERVICE_PORT
check_for_keystone check_for_keystone
check_for_db
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0" export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0"

View File

@ -4,7 +4,7 @@
. /opt/kolla/config-ceilometer.sh . /opt/kolla/config-ceilometer.sh
check_required_vars KEYSTONE_ADMIN_TOKEN RABBITMQ_SERVICE_HOST KEYSTONE_AUTH_PROTOCOL CEILOMETER_KEYSTONE_USER ADMIN_TENANT_NAME check_required_vars KEYSTONE_ADMIN_TOKEN RABBITMQ_SERVICE_HOST RABBIT_PASSWORD
check_for_keystone check_for_keystone
@ -19,7 +19,7 @@ crudini --set /etc/nova/nova.conf DEFAULT notification_driver ceilometer.compute
cfg=/etc/ceilometer/ceilometer.conf cfg=/etc/ceilometer/ceilometer.conf
crudini --set $cfg publisher_rpc metering_secret ${KEYSTONE_ADMIN_TOKEN} crudini --set $cfg publisher_rpc metering_secret ${KEYSTONE_ADMIN_TOKEN}
crudini --set $cfg rabbit_host ${RABBITMQ_SERVICE_HOST} crudini --set $cfg rabbit_host ${RABBITMQ_SERVICE_HOST}
crudini --set $cfg rabbit_password ${RABBITMQ_PASS} crudini --set $cfg rabbit_password ${RABBIT_PASSWORD}
exec /usr/bin/ceilometer-agent-compute exec /usr/bin/ceilometer-agent-compute

View File

@ -1,29 +1,21 @@
#!/bin/bash -e #!/bin/bash -e
: ${CINDER_DB_USER%:=cinder} : ${CINDER_DB_USER:=cinder}
: ${CINDER_DB_NAME:=cinder} : ${CINDER_DB_NAME:=cinder}
: ${KEYSTONE_AUTH_PROTOCOL:=http} : ${KEYSTONE_AUTH_PROTOCOL:=http}
: ${CINDER_KEYSTONE_USER:=cinder} : ${CINDER_KEYSTONE_USER:=cinder}
: ${ADMIN_TENANT_NAME:=admin} : ${ADMIN_TENANT_NAME:=admin}
if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then
echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2
exit 1
fi
if ! [ "$DB_ROOT_PASSWORD" ]; then
echo "*** Missing DB_ROOT_PASSWORD" >&2
exit 1
fi
if ! [ "$CINDER_DB_PASSWORD" ]; then if ! [ "$CINDER_DB_PASSWORD" ]; then
CINDER_DB_PASSWORD=$(openssl rand -hex 15) CINDER_DB_PASSWORD=$(openssl rand -hex 15)
export CINDER_DB_PASSWORD export CINDER_DB_PASSWORD
fi fi
mysql -h ${MARIADB_PORT_3306_TCP_ADDR} -u root \ check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
-p${DB_ROOT_PASSWORD} mysql <<EOF CINDER_ADMIN_PASSWORD
EOF check_for_db
mysql -h ${MARIADB_SERVICE_HOST} -u root -p"${DB_ROOT_PASSWORD}" mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${CINDER_DB_NAME}; CREATE DATABASE IF NOT EXISTS ${CINDER_DB_NAME};
GRANT ALL PRIVILEGES ON glance* TO GRANT ALL PRIVILEGES ON glance* TO
'${CINDER_DB_USER}'@'%' IDENTIFIED BY '${CINDER_DB_PASSWORD}' '${CINDER_DB_USER}'@'%' IDENTIFIED BY '${CINDER_DB_PASSWORD}'
@ -143,7 +135,7 @@ crudini --set /etc/cinder/cinder.conf \
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0" export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
/bin/keystone user-create --name ${CINDER_KEYSTONE_USER} --pass ${CINDER_ADMIN_PASSWORD} /bin/keystone user-create --name ${CINDER_KEYSTONE_USER} --pass ${CINDER_ADMIN_PASSWORD}
/bin/keystone role-create --name ${CINDER_KEYSTONE_USER} /bin/keystone role-create --name ${CINDER_KEYSTONE_USER}

View File

@ -11,7 +11,9 @@ set -e
: ${KEYSTONE_AUTH_PROTOCOL:=http} : ${KEYSTONE_AUTH_PROTOCOL:=http}
: ${PUBLIC_IP:=$GLANCE_API_PORT_9292_TCP_ADDR} : ${PUBLIC_IP:=$GLANCE_API_PORT_9292_TCP_ADDR}
check_required_vars GLANCE_DB_PASSWORD GLANCE_KEYSTONE_PASSWORD check_for_db
check_required_vars GLANCE_DB_PASSWORD GLANCE_KEYSTONE_PASSWORD \
KEYSTONE_PUBLIC_SERVICE_HOST
dump_vars dump_vars
cat > /openrc <<EOF cat > /openrc <<EOF

View File

@ -13,7 +13,10 @@ set -e
: ${RABBIT_USER:=guest} : ${RABBIT_USER:=guest}
: ${RABBIT_PASSWORD:=guest} : ${RABBIT_PASSWORD:=guest}
check_required_vars HEAT_DB_PASSWORD HEAT_KEYSTONE_PASSWORD check_required_vars HEAT_DB_PASSWORD HEAT_KEYSTONE_PASSWORD \
KEYSTONE_PUBLIC_SERVICE_HOST RABBITMQ_SERVICE_HOST
check_for_db
dump_vars dump_vars
cat > /openrc <<EOF cat > /openrc <<EOF

View File

@ -3,8 +3,7 @@
. /opt/kolla/kolla-common.sh . /opt/kolla/kolla-common.sh
. /opt/kolla/config-heat.sh . /opt/kolla/config-heat.sh
check_required_vars MARIADB_SERVICE_HOST DB_ROOT_PASSWORD \ check_required_vars HEAT_DB_NAME HEAT_DB_USER HEAT_DB_PASSWORD
HEAT_DB_NAME HEAT_DB_USER HEAT_DB_PASSWORD
check_for_db check_for_db
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF

View File

@ -5,8 +5,6 @@ set -e
. /opt/kolla/kolla-common.sh . /opt/kolla/kolla-common.sh
check_required_vars HORIZON_KEYSTONE_USER
check_for_keystone check_for_keystone
check_for_glance check_for_glance
check_for_nova check_for_nova

View File

@ -9,7 +9,8 @@ set -e
check_for_db check_for_db
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_DB_PASSWORD \ check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_DB_PASSWORD \
KEYSTONE_ADMIN_PASSWORD ADMIN_TENANT_NAME \ KEYSTONE_ADMIN_PASSWORD ADMIN_TENANT_NAME \
KEYSTONE_PUBLIC_SERVICE_HOST KEYSTONE_ADMIN_SERVICE_HOST KEYSTONE_PUBLIC_SERVICE_HOST KEYSTONE_ADMIN_SERVICE_HOST \
PUBLIC_IP
dump_vars dump_vars
mysql -h ${MARIADB_SERVICE_HOST} -u root -p"${DB_ROOT_PASSWORD}" mysql <<EOF mysql -h ${MARIADB_SERVICE_HOST} -u root -p"${DB_ROOT_PASSWORD}" mysql <<EOF

View File

@ -9,6 +9,8 @@ set -e
: ${DHCP_DRIVER:=neutron.agent.linux.dhcp.Dnsmasq} : ${DHCP_DRIVER:=neutron.agent.linux.dhcp.Dnsmasq}
: ${USE_NAMESPACES:=false} : ${USE_NAMESPACES:=false}
check_required_vars VERBOSE_LOGGING DEBUG_LOGGING
cfg=/etc/neutron/dhcp_agent.ini cfg=/etc/neutron/dhcp_agent.ini
# Configure dhcp_agent.ini # Configure dhcp_agent.ini

View File

@ -8,6 +8,8 @@ set -e
: ${INTERFACE_DRIVER:=neutron.agent.linux.interface.BridgeInterfaceDriver} : ${INTERFACE_DRIVER:=neutron.agent.linux.interface.BridgeInterfaceDriver}
: ${USE_NAMESPACES:=false} : ${USE_NAMESPACES:=false}
check_required_vars VERBOSE_LOGGING DEBUG_LOGGING
cfg=/etc/neutron/l3_agent.ini cfg=/etc/neutron/l3_agent.ini
# Configure l3_agent.ini # Configure l3_agent.ini

View File

@ -8,6 +8,8 @@ set -e
: ${BRIDGE_PHYSICAL_INTERFACE:=eth1} : ${BRIDGE_PHYSICAL_INTERFACE:=eth1}
: ${ML2_FLAT_NETWORK:=physnet1} : ${ML2_FLAT_NETWORK:=physnet1}
check_required_vars PUBLIC_IP
cfg=/etc/neutron/plugins/ml2/ml2_conf.ini cfg=/etc/neutron/plugins/ml2/ml2_conf.ini
# Configure ml2_conf.ini # Configure ml2_conf.ini

View File

@ -7,6 +7,11 @@ set -e
: ${KEYSTONE_REGION:=RegionOne} : ${KEYSTONE_REGION:=RegionOne}
check_required_vars VERBOSE_LOGGING DEBUG_LOGGING KEYSTONE_AUTH_PROTOCOL \
KEYSTONE_PUBLIC_SERVICE_HOST ADMIN_TENANT_NAME \
NEUTRON_KEYSTONE_USER NEUTRON_KEYSTONE_PASSWORD \
NEUTRON_SHARED_SECRET NOVA_API_SERVICE_HOST
cfg=/etc/neutron/metadata_agent.ini cfg=/etc/neutron/metadata_agent.ini
# Configure metadata_agent.ini # Configure metadata_agent.ini

View File

@ -15,7 +15,9 @@ set -e
: ${VERBOSE_LOGGING:=true} : ${VERBOSE_LOGGING:=true}
: ${DEBUG_LOGGING:=false} : ${DEBUG_LOGGING:=false}
check_required_vars NEUTRON_KEYSTONE_PASSWORD check_required_vars NEUTRON_KEYSTONE_PASSWORD \
KEYSTONE_PUBLIC_SERVICE_HOST RABBITMQ_SERVICE_HOST
dump_vars dump_vars
cat > /openrc <<EOF cat > /openrc <<EOF

View File

@ -6,9 +6,11 @@ set -e
. /opt/kolla/config-neutron.sh . /opt/kolla/config-neutron.sh
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_AUTH_PROTOCOL NOVA_API_SERVICE_HOST \
NOVA_ADMIN_PASSWORD NEUTRON_DB_NAME NEUTRON_DB_USER \
NEUTRON_KEYSTONE_USER NEUTRON_KEYSTONE_PASSWORD \ NEUTRON_KEYSTONE_USER NEUTRON_KEYSTONE_PASSWORD \
ADMIN_TENANT_NAME NEUTRON_SERVER_SERVICE_HOST \ ADMIN_TENANT_NAME NEUTRON_SERVER_SERVICE_HOST \
PUBLIC_IP PUBLIC_IP NEUTRON_DB_PASSWORD
check_for_keystone check_for_keystone
check_for_db check_for_db

View File

@ -11,8 +11,10 @@
: ${RABBIT_PASSWORD:=guest} : ${RABBIT_PASSWORD:=guest}
: ${NETWORK_MANAGER:=nova} : ${NETWORK_MANAGER:=nova}
check_required_vars KEYSTONE_ADMIN_TOKEN \ check_for_db
NOVA_DB_PASSWORD check_required_vars KEYSTONE_ADMIN_TOKEN NOVA_DB_PASSWORD \
RABBITMQ_SERVICE_HOST GLANCE_API_SERVICE_HOST \
KEYSTONE_PUBLIC_SERVICE_HOST PUBLIC_IP
cfg=/etc/nova/nova.conf cfg=/etc/nova/nova.conf
@ -75,6 +77,7 @@ if [ "${NETWORK_MANAGER}" == "nova" ] ; then
crudini --set $cfg DEFAULT flat_network_bridge br100 crudini --set $cfg DEFAULT flat_network_bridge br100
crudini --set $cfg DEFAULT public_interface eth1 crudini --set $cfg DEFAULT public_interface eth1
elif [ "${NETWORK_MANAGER}" == "neutron" ] ; then elif [ "${NETWORK_MANAGER}" == "neutron" ] ; then
check_required_vars NEUTRON_SHARED_SECRET
crudini --set $cfg DEFAULT service_neutron_metadata_proxy True crudini --set $cfg DEFAULT service_neutron_metadata_proxy True
crudini --set $cfg DEFAULT neutron_metadata_proxy_shared_secret ${NEUTRON_SHARED_SECRET} crudini --set $cfg DEFAULT neutron_metadata_proxy_shared_secret ${NEUTRON_SHARED_SECRET}
crudini --set $cfg DEFAULT neutron_default_tenant_id default crudini --set $cfg DEFAULT neutron_default_tenant_id default

View File

@ -4,6 +4,10 @@ set -e
. /opt/kolla/config-nova.sh . /opt/kolla/config-nova.sh
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
NOVA_KEYSTONE_USER NOVA_KEYSTONE_PASSWORD \
ADMIN_TENANT_NAME NOVA_API_SERVICE_HOST \
NOVA_EC2_API_SERVICE_HOST PUBLIC_IP
check_for_keystone check_for_keystone
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"

View File

@ -4,6 +4,7 @@ set -e
. /opt/kolla/config-nova.sh . /opt/kolla/config-nova.sh
check_required_vars NOVA_DB_NAME NOVA_DB_USER NOVA_DB_PASSWORD
check_for_db check_for_db
mysql -h ${MARIADB_SERVICE_HOST} -u root \ mysql -h ${MARIADB_SERVICE_HOST} -u root \

View File

@ -6,15 +6,10 @@
: ${SWIFT_KEYSTONE_USER:=swift} : ${SWIFT_KEYSTONE_USER:=swift}
: ${ADMIN_TENANT_NAME:=admin} : ${ADMIN_TENANT_NAME:=admin}
if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2 SWIFT_ADMIN_PASSWORD
exit 1 check_for_db
fi check_for_keystone
if ! [ "$DB_ROOT_PASSWORD" ]; then
echo "*** Missing DB_ROOT_PASSWORD" >&2
exit 1
fi
if ! [ "$SWIFT_DB_PASSWORD" ]; then if ! [ "$SWIFT_DB_PASSWORD" ]; then
SWIFT_DB_PASSWORD=$(openssl rand -hex 15) SWIFT_DB_PASSWORD=$(openssl rand -hex 15)
@ -23,7 +18,7 @@ fi
sh /opt/swift/config-swift.sh account-server sh /opt/swift/config-swift.sh account-server
mysql -h ${MARIADB_PORT_3306_TCP_ADDR} -u root \ mysql -h ${MARIADB_SERVICE_HOST} -u root \
-p${DB_ROOT_PASSWORD} mysql <<EOF -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${SWIFT_DB_NAME}; CREATE DATABASE IF NOT EXISTS ${SWIFT_DB_NAME};
GRANT ALL PRIVILEGES ON swift* TO GRANT ALL PRIVILEGES ON swift* TO
@ -31,7 +26,7 @@ GRANT ALL PRIVILEGES ON swift* TO
EOF EOF
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0" export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
/bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD} /bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD}
/bin/keystone role-create --name ${SWIFT_KEYSTONE_USER} /bin/keystone role-create --name ${SWIFT_KEYSTONE_USER}

View File

@ -6,15 +6,10 @@
: ${SWIFT_KEYSTONE_USER:=swift} : ${SWIFT_KEYSTONE_USER:=swift}
: ${ADMIN_TENANT_NAME:=admin} : ${ADMIN_TENANT_NAME:=admin}
if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2 SWIFT_ADMIN_PASSWORD
exit 1 check_for_db
fi check_for_keystone
if ! [ "$DB_ROOT_PASSWORD" ]; then
echo "*** Missing DB_ROOT_PASSWORD" >&2
exit 1
fi
if ! [ "$SWIFT_DB_PASSWORD" ]; then if ! [ "$SWIFT_DB_PASSWORD" ]; then
SWIFT_DB_PASSWORD=$(openssl rand -hex 15) SWIFT_DB_PASSWORD=$(openssl rand -hex 15)
@ -23,7 +18,7 @@ fi
sh /opt/swift/config-swift.sh container sh /opt/swift/config-swift.sh container
mysql -h ${MARIADB_PORT_3306_TCP_ADDR} -u root \ mysql -h ${MARIADB_SERVICE_HOST} -u root \
-p${DB_ROOT_PASSWORD} mysql <<EOF -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${SWIFT_DB_NAME}; CREATE DATABASE IF NOT EXISTS ${SWIFT_DB_NAME};
GRANT ALL PRIVILEGES ON swift* TO GRANT ALL PRIVILEGES ON swift* TO
@ -31,7 +26,7 @@ GRANT ALL PRIVILEGES ON swift* TO
EOF EOF
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0" export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
/bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD} /bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD}
/bin/keystone role-create --name ${SWIFT_KEYSTONE_USER} /bin/keystone role-create --name ${SWIFT_KEYSTONE_USER}

View File

@ -6,15 +6,10 @@
: ${SWIFT_KEYSTONE_USER:=swift} : ${SWIFT_KEYSTONE_USER:=swift}
: ${ADMIN_TENANT_NAME:=admin} : ${ADMIN_TENANT_NAME:=admin}
if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2 SWIFT_ADMIN_PASSWORD
exit 1 check_for_db
fi check_for_keystone
if ! [ "$DB_ROOT_PASSWORD" ]; then
echo "*** Missing DB_ROOT_PASSWORD" >&2
exit 1
fi
if ! [ "$SWIFT_DB_PASSWORD" ]; then if ! [ "$SWIFT_DB_PASSWORD" ]; then
SWIFT_DB_PASSWORD=$(openssl rand -hex 15) SWIFT_DB_PASSWORD=$(openssl rand -hex 15)
@ -23,7 +18,7 @@ fi
sh /opt/swift/config-swift.sh engine sh /opt/swift/config-swift.sh engine
mysql -h ${MARIADB_PORT_3306_TCP_ADDR} -u root \ mysql -h ${MARIADB_SERVICE_HOST} -u root \
-p${DB_ROOT_PASSWORD} mysql <<EOF -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${SWIFT_DB_NAME}; CREATE DATABASE IF NOT EXISTS ${SWIFT_DB_NAME};
GRANT ALL PRIVILEGES ON swift* TO GRANT ALL PRIVILEGES ON swift* TO
@ -31,7 +26,7 @@ GRANT ALL PRIVILEGES ON swift* TO
EOF EOF
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0" export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
/bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD} /bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD}
/bin/keystone role-create --name ${SWIFT_KEYSTONE_USER} /bin/keystone role-create --name ${SWIFT_KEYSTONE_USER}

View File

@ -5,16 +5,12 @@ set -e
. /opt/kolla/kolla-common.sh . /opt/kolla/kolla-common.sh
: ${ADMIN_TENANT_NAME:=admin} : ${ADMIN_TENANT_NAME:=admin}
: ${ZAQAR_DB_NAME:=zaqar}
: ${ZAQAR_DB_USER:=zaqar}
: ${ZAQAR_KEYSTONE_USER:=zaqar} : ${ZAQAR_KEYSTONE_USER:=zaqar}
: ${KEYSTONE_AUTH_PROTOCOL:=http} : ${KEYSTONE_AUTH_PROTOCOL:=http}
check_required_vars ZAQAR_DB_PASSWORD ZAQAR_KEYSTONE_PASSWORD \ check_required_vars ZAQAR_KEYSTONE_PASSWORD ZAQAR_SERVER_SERVICE_HOST \
KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST KEYSTONE_ADMIN_TOKEN \
PUBLIC_IP
dump_vars dump_vars
#check_for_mongodb #check_for_mongodb