Everything provided by the openstack-db element is already done in the boot-stack elemnt or one of it dependencies. So it shouldn't be included as a dependency. The only piece that is missing is the line the installs the cinder service because boot-stack doesn't depend on cinder. The cinder element currently seems to not be working. So I'm placing that line to install the cinder service in the boot-stack element, this can be removed again once the cinder element is working. This will allow me to make progress on using the new source-interface, as multiple elements will no longer be adding the same service. Change-Id: I808a580cb8731c83fff6dd50e72db4a29150a74e
97 lines
2.5 KiB
Bash
Executable File
97 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
set -eux
|
|
|
|
install-packages git build-essential python-dev libssl-dev python-netaddr
|
|
install-packages tgt busybox # to run diskimage-builder for deploy ramdisk
|
|
|
|
install -m 0755 -o root -g root -d /opt/stack/boot-stack
|
|
|
|
# tools
|
|
for f in `ls $(dirname $0)/../bin`; do
|
|
install -m 0755 -o root -g root $(dirname $0)/../bin/$f /usr/local/bin/$f
|
|
done
|
|
|
|
# TODO: remove when pbr is fixed in version 0.5.10
|
|
sudo pip install -U git+https://github.com/openstack-dev/pbr.git
|
|
|
|
# openstack creds
|
|
# TODO: generate random creds.
|
|
install -m 0755 -o root -g root $(dirname $0)/../stackrc /root/stackrc
|
|
echo "source /root/stackrc" >> /root/.bash_profile
|
|
|
|
# client tools
|
|
for client in nova quantum glance heat; do
|
|
repo=python-${client}client
|
|
|
|
virtualenv --system-site-packages /opt/stack/venvs/$repo
|
|
set +u
|
|
source /opt/stack/venvs/$repo/bin/activate
|
|
set -u
|
|
|
|
git clone --depth 1 https://github.com/openstack/$repo.git /opt/stack/$repo
|
|
|
|
pushd /opt/stack/$repo
|
|
if [ -e requirements.txt ]; then
|
|
PIP_INDEX_URL=http://pypi.openstack.org/openstack/ \
|
|
pip install -r requirements.txt
|
|
elif [ -e tools/pip-requires ]; then
|
|
PIP_INDEX_URL=http://pypi.openstack.org/openstack/ \
|
|
pip install -r tools/pip-requires
|
|
fi
|
|
python setup.py develop --script-dir /usr/local/bin
|
|
popd
|
|
|
|
set +u
|
|
deactivate
|
|
set -u
|
|
|
|
done
|
|
|
|
# image toolchain
|
|
git clone https://github.com/stackforge/diskimage-builder.git /opt/stack/diskimage-builder
|
|
|
|
# db
|
|
install-packages mysql-server python-mysqldb
|
|
|
|
my_cnf=
|
|
if [ -f /etc/mysql/my.cnf ]; then
|
|
my_cnf=/etc/mysql/my.cnf # Ubuntu
|
|
elif [ -f /etc/my.cnf ]; then
|
|
my_cnf=/etc/my.cnf # Fedora/RHEL
|
|
fi
|
|
|
|
sed -i 's/127.0.0.1/0.0.0.0/g' $my_cnf
|
|
|
|
# Remove this once the cinder element can be added as a dependency of this element.
|
|
# https://bugs.launchpad.net/tripleo/+bug/1197048
|
|
# https://bugs.launchpad.net/tripleo/+bug/1197371
|
|
os-svc-install -u cinder -r https://github.com/openstack/cinder.git
|
|
|
|
function deps {
|
|
if hash apt-get &> /dev/null; then
|
|
apt-get update
|
|
fi
|
|
install-packages screen ccze
|
|
install-packages git ipmitool python-dev python-pip python-greenlet python-mysqldb libxml2-dev libxslt-dev python-zmq
|
|
install-packages openvswitch-common openvswitch-controller openvswitch-switch open-iscsi
|
|
install-packages python-numpy python-lxml
|
|
}
|
|
|
|
function ip_forwarding {
|
|
cat > /etc/sysctl.conf <<eof
|
|
net.ipv4.ip_forward=1
|
|
eof
|
|
}
|
|
|
|
function enable_services {
|
|
DISTRO=`lsb_release -si` || true
|
|
|
|
if [ $DISTRO = "Fedora" ]; then
|
|
systemctl enable mysqld.service
|
|
fi
|
|
}
|
|
|
|
deps
|
|
ip_forwarding
|
|
enable_services
|