Wait until mongo responds after restart
Changed because some gate runs failed trying to connect to mongo after a restart. Also fixes a couple of incorrect conditionals. Change-Id: I8d14be62617976ef97bb1247f30afc6bb8a3f103
This commit is contained in:
parent
3d1fade039
commit
aec888f6c8
@ -32,6 +32,7 @@ export TEMPEST_FLAT_CIDR=${TEMPEST_FLAT_CIDR:-"172.29.248.0/22"}
|
|||||||
export FLUSH_IPTABLES=${FLUSH_IPTABLES:-"yes"}
|
export FLUSH_IPTABLES=${FLUSH_IPTABLES:-"yes"}
|
||||||
export RABBITMQ_PACKAGE_URL=${RABBITMQ_PACKAGE_URL:-""}
|
export RABBITMQ_PACKAGE_URL=${RABBITMQ_PACKAGE_URL:-""}
|
||||||
export SYMLINK_DIR=${SYMLINK_DIR:-"$(pwd)/logs"}
|
export SYMLINK_DIR=${SYMLINK_DIR:-"$(pwd)/logs"}
|
||||||
|
export MONGO_HOST=172.29.236.100
|
||||||
|
|
||||||
# Default disabled fatal deprecation warnings
|
# Default disabled fatal deprecation warnings
|
||||||
export CINDER_FATAL_DEPRECATIONS=${CINDER_FATAL_DEPRECATIONS:-"no"}
|
export CINDER_FATAL_DEPRECATIONS=${CINDER_FATAL_DEPRECATIONS:-"no"}
|
||||||
@ -294,18 +295,23 @@ scripts/pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml
|
|||||||
sed -i "s/keystone_auth_admin_password:.*/keystone_auth_admin_password: ${ADMIN_PASSWORD}/" /etc/openstack_deploy/user_secrets.yml
|
sed -i "s/keystone_auth_admin_password:.*/keystone_auth_admin_password: ${ADMIN_PASSWORD}/" /etc/openstack_deploy/user_secrets.yml
|
||||||
sed -i "s/external_lb_vip_address:.*/external_lb_vip_address: ${PUBLIC_ADDRESS}/" /etc/openstack_deploy/openstack_user_config.yml
|
sed -i "s/external_lb_vip_address:.*/external_lb_vip_address: ${PUBLIC_ADDRESS}/" /etc/openstack_deploy/openstack_user_config.yml
|
||||||
|
|
||||||
if [ ${DEPLOY_CEILOMETER} ]; then
|
if [ ${DEPLOY_CEILOMETER} == "yes" ]; then
|
||||||
# Install mongodb on the aio1 host
|
# Install mongodb on the aio1 host
|
||||||
apt-get install mongodb-server mongodb-clients python-pymongo -y
|
apt-get install mongodb-server mongodb-clients python-pymongo -y
|
||||||
# Change bind_ip to management ip
|
# Change bind_ip to management ip
|
||||||
sed -i "s/^bind_ip.*/bind_ip = 172.29.236.100/" /etc/mongodb.conf
|
sed -i "s/^bind_ip.*/bind_ip = $MONGO_HOST/" /etc/mongodb.conf
|
||||||
# Asserting smallfiles key
|
# Asserting smallfiles key
|
||||||
sed -i "s/^smallfiles.*/smallfiles = true/" /etc/mongodb.conf
|
sed -i "s/^smallfiles.*/smallfiles = true/" /etc/mongodb.conf
|
||||||
service mongodb restart
|
service mongodb restart
|
||||||
# Giving the service a second..
|
|
||||||
|
# Wait for mongodb to restart
|
||||||
|
for i in {1..12}
|
||||||
|
do
|
||||||
|
mongo --host $MONGO_HOST --eval ' ' && break
|
||||||
sleep 5
|
sleep 5
|
||||||
|
done
|
||||||
#Adding the ceilometer database
|
#Adding the ceilometer database
|
||||||
mongo --host 172.29.236.100 --eval '
|
mongo --host $MONGO_HOST --eval '
|
||||||
db = db.getSiblingDB("ceilometer");
|
db = db.getSiblingDB("ceilometer");
|
||||||
db.addUser({user: "ceilometer",
|
db.addUser({user: "ceilometer",
|
||||||
pwd: "ceilometer",
|
pwd: "ceilometer",
|
||||||
@ -316,7 +322,7 @@ if [ ${DEPLOY_CEILOMETER} ]; then
|
|||||||
# Change the ceilometer user variables necessary for deployment
|
# Change the ceilometer user variables necessary for deployment
|
||||||
sed -i "s/ceilometer_db_ip:.*/ceilometer_db_ip: \"\{\{ hostvars\['aio1'\]\['ansible_ssh_host'\] \}\}\"/" /etc/openstack_deploy/user_variables.yml
|
sed -i "s/ceilometer_db_ip:.*/ceilometer_db_ip: \"\{\{ hostvars\['aio1'\]\['ansible_ssh_host'\] \}\}\"/" /etc/openstack_deploy/user_variables.yml
|
||||||
# Enable ceilometer for all other openstack services
|
# Enable ceilometer for all other openstack services
|
||||||
if [ ${DEPLOY_SWIFT} ]; then
|
if [ ${DEPLOY_SWIFT} == "yes" ]; then
|
||||||
sed -i "s/swift_ceilometer_enabled:.*/swift_ceilometer_enabled: True/" /etc/openstack_deploy/user_variables.yml
|
sed -i "s/swift_ceilometer_enabled:.*/swift_ceilometer_enabled: True/" /etc/openstack_deploy/user_variables.yml
|
||||||
fi
|
fi
|
||||||
sed -i "s/heat_ceilometer_enabled:.*/heat_ceilometer_enabled: True/" /etc/openstack_deploy/user_variables.yml
|
sed -i "s/heat_ceilometer_enabled:.*/heat_ceilometer_enabled: True/" /etc/openstack_deploy/user_variables.yml
|
||||||
|
Loading…
x
Reference in New Issue
Block a user