kolla-ansible/docker/keystone/extend_start.sh
Sam Yaple 5f200e0446 Fix issue with su and bad kernels
Long story short, some kernels before 3.15 had an issue with using su
in a container when the network namespace was --net=host. The gate
has a 3.10 and a 3.13 kernel and has a problem with this. This changes
everything to use sudo

backport: liberty
Partially-Implements: blueprint functional-testing-gate
Change-Id: I4d79ccaa1cddffcc8393f64e7e1be2538efe33e5
2015-10-13 15:13:55 +00:00

31 lines
1.1 KiB
Bash

#!/bin/bash
if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \
"${KOLLA_BASE_DISTRO}" == "debian" ]]; then
# Loading Apache2 ENV variables
source /etc/apache2/envvars
fi
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
sudo -H -u keystone keystone-manage db_sync
# Start the api to set initial endpoint and users with the admin_token
$CMD
sleep 5
openstack service create --name keystone --description "OpenStack Identity" identity
openstack endpoint create --region "${REGION_NAME}" \
--publicurl "${PUBLIC_URL}" \
--internalurl "${INTERNAL_URL}" \
--adminurl "${ADMIN_URL}" \
identity
openstack project create --description "Admin Project" admin
openstack user create --password "${KEYSTONE_ADMIN_PASSWORD}" admin
openstack role create admin
openstack role add --project admin --user admin admin
exit 0
fi
ARGS="-DFOREGROUND"