Read affinity from environment

This patch allows a user to set the number of containers per host for
each type of container that has a default affinity greater than 1 for an
AIO build.

Currently this list is:
 * keystone
 * galera
 * rabbit_mq
 * horizon
 * repo

For example, one could set NUM_keystone_CONTAINERS=1 before running an
AIO to ensure that only one keystone container is built.

Change-Id: If90704a50414150ca37584e1f823ba0e85e287ac
Partially-Implements: blueprint split-aio-gates
This commit is contained in:
Hugh Saunders 2015-07-14 14:16:25 +01:00 committed by Kevin Carter
parent 037829465e
commit 39409db9b9

View File

@ -295,6 +295,18 @@ 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/external_lb_vip_address:.*/external_lb_vip_address: ${PUBLIC_ADDRESS}/" /etc/openstack_deploy/openstack_user_config.yml
# Change affinities (number of containers per host) if the appropriate
# environment variables are set.
for container_type in keystone galera rabbit_mq horizon repo
do
var_name="NUM_${container_type}_CONTAINER"
set +u
num=${!var_name}
set -u
[[ -z $num ]] && continue
sed -i "s/${container_type}_container:.*/${container_type}_container: ${num}/" /etc/openstack_deploy/openstack_user_config.yml
done
if [ ${DEPLOY_CEILOMETER} == "yes" ]; then
# Install mongodb on the aio1 host
apt-get install mongodb-server mongodb-clients python-pymongo -y