Improve Fedora support for boot-stack and openstack-db elements

- distro-specific DNS resolution configuration
- handle distro-specific location for the my.cnf file
- prevent from blindly running the apt-get command

Change-Id: I6f334913dedf5c3678fa8385226ee9c0c256a319
This commit is contained in:
Lucas Alvares Gomes 2013-04-26 16:21:13 +01:00
parent f842d0add9
commit 9cccf0295f
2 changed files with 29 additions and 5 deletions

View File

@ -1,12 +1,18 @@
#!/bin/bash
set -eux
install-packages git build-essential python-dev
install-packages git build-essential python-dev libssl-dev
install-packages tgt busybox # to run diskimage-builder for deploy ramdisk
install -m 0755 -o root -g root -d /opt/stack/boot-stack
echo 'nameserver 8.8.8.8' > /etc/resolvconf/resolv.conf.d/head
resolv_conf=/etc/resolv.conf
# In Ubuntu 12.04 and over the handling of /etc/resolv.conf changed
if [ -f /etc/resolvconf/resolv.conf.d/head ]; then
resolv_conf=/etc/resolvconf/resolv.conf.d/head
fi
echo 'nameserver 8.8.8.8' > $resolv_conf
cat > /etc/hosts <<eof
127.0.0.1 ubuntu localhost
@ -54,10 +60,20 @@ install-packages rabbitmq-server
# db
install-packages mysql-server python-mysqldb
sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
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
function deps {
apt-get update
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

View File

@ -2,7 +2,15 @@
set -eu
install-packages mysql-server python-mysqldb
sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
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
os-svc-install -u keystone -r https://github.com/openstack/keystone.git
os-svc-install -u cinder -r https://github.com/openstack/cinder.git