Merge "E) Add support for Fedora 16"
This commit is contained in:
commit
3db875c21e
@ -2,7 +2,7 @@ DevStack is a set of scripts and utilities to quickly deploy an OpenStack cloud.
|
|||||||
|
|
||||||
# Goals
|
# Goals
|
||||||
|
|
||||||
* To quickly build dev OpenStack environments in a clean Oneiric or Precise environment
|
* To quickly build dev OpenStack environments in a clean Ubuntu or Fedora environment
|
||||||
* To describe working configurations of OpenStack (which code branches work together? what do config files look like for those branches?)
|
* To describe working configurations of OpenStack (which code branches work together? what do config files look like for those branches?)
|
||||||
* To make it easier for developers to dive into OpenStack so that they can productively contribute without having to understand every part of the system at once
|
* To make it easier for developers to dive into OpenStack so that they can productively contribute without having to understand every part of the system at once
|
||||||
* To make it easy to prototype cross-project features
|
* To make it easy to prototype cross-project features
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
WSGIScriptAlias / %HORIZON_DIR%/openstack_dashboard/wsgi/django.wsgi
|
WSGIScriptAlias / %HORIZON_DIR%/openstack_dashboard/wsgi/django.wsgi
|
||||||
WSGIDaemonProcess horizon user=%USER% group=%GROUP% processes=3 threads=10
|
WSGIDaemonProcess horizon user=%USER% group=%GROUP% processes=3 threads=10 home=%HORIZON_DIR%
|
||||||
|
|
||||||
SetEnv APACHE_RUN_USER %USER%
|
SetEnv APACHE_RUN_USER %USER%
|
||||||
SetEnv APACHE_RUN_GROUP %GROUP%
|
SetEnv APACHE_RUN_GROUP %GROUP%
|
||||||
WSGIProcessGroup horizon
|
WSGIProcessGroup horizon
|
||||||
|
|
||||||
DocumentRoot %HORIZON_DIR%/.blackhole/
|
DocumentRoot %HORIZON_DIR%/.blackhole/
|
||||||
Alias /media %HORIZON_DIR%/openstack_dashboard/static
|
Alias /media %HORIZON_DIR%/openstack_dashboard/static
|
||||||
Alias /vpn /opt/stack/vpn
|
|
||||||
|
|
||||||
<Directory />
|
<Directory />
|
||||||
Options FollowSymLinks
|
Options FollowSymLinks
|
||||||
@ -21,8 +21,9 @@
|
|||||||
allow from all
|
allow from all
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
ErrorLog /var/log/apache2/error.log
|
ErrorLog /var/log/%APACHE_NAME%/horizon_error.log
|
||||||
LogLevel warn
|
LogLevel warn
|
||||||
CustomLog /var/log/apache2/access.log combined
|
CustomLog /var/log/%APACHE_NAME%/horizon_access.log combined
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
|
|
||||||
|
WSGISocketPrefix /var/run/%APACHE_NAME%
|
@ -1,3 +1,5 @@
|
|||||||
|
django-mailer # dist:f16
|
||||||
|
django-nose # dist:f16
|
||||||
django-nose-selenium
|
django-nose-selenium
|
||||||
pycrypto==2.3
|
pycrypto==2.3
|
||||||
python-cloudfiles
|
python-cloudfiles
|
||||||
|
14
files/rpms/general
Normal file
14
files/rpms/general
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
curl
|
||||||
|
euca2ools # only for testing client
|
||||||
|
git-core
|
||||||
|
openssh-server
|
||||||
|
psmisc
|
||||||
|
pylint
|
||||||
|
python-pep8
|
||||||
|
python-pip
|
||||||
|
python-unittest2
|
||||||
|
python-virtualenv
|
||||||
|
screen
|
||||||
|
tcpdump
|
||||||
|
unzip
|
||||||
|
wget
|
8
files/rpms/glance
Normal file
8
files/rpms/glance
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
python-argparse
|
||||||
|
python-eventlet
|
||||||
|
python-greenlet
|
||||||
|
python-paste-deploy
|
||||||
|
python-routes
|
||||||
|
python-sqlalchemy
|
||||||
|
python-wsgiref
|
||||||
|
pyxattr
|
25
files/rpms/horizon
Normal file
25
files/rpms/horizon
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Django
|
||||||
|
django-registration
|
||||||
|
gcc
|
||||||
|
httpd # NOPRIME
|
||||||
|
mod_wsgi # NOPRIME
|
||||||
|
pylint
|
||||||
|
python-anyjson
|
||||||
|
python-boto
|
||||||
|
python-coverage
|
||||||
|
python-dateutil
|
||||||
|
python-eventlet
|
||||||
|
python-greenlet
|
||||||
|
python-httplib2
|
||||||
|
python-kombu
|
||||||
|
python-migrate
|
||||||
|
python-mox
|
||||||
|
python-nose
|
||||||
|
python-paste
|
||||||
|
python-paste-deploy
|
||||||
|
python-pep8
|
||||||
|
python-routes
|
||||||
|
python-sphinx
|
||||||
|
python-sqlalchemy
|
||||||
|
python-webob
|
||||||
|
pyxattr
|
11
files/rpms/keystone
Normal file
11
files/rpms/keystone
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
python-greenlet
|
||||||
|
python-lxml
|
||||||
|
python-paste
|
||||||
|
python-paste-deploy
|
||||||
|
python-paste-script
|
||||||
|
python-routes
|
||||||
|
python-setuptools
|
||||||
|
python-sqlalchemy
|
||||||
|
python-sqlite2
|
||||||
|
python-webob
|
||||||
|
sqlite
|
1
files/rpms/n-api
Normal file
1
files/rpms/n-api
Normal file
@ -0,0 +1 @@
|
|||||||
|
python-dateutil
|
3
files/rpms/n-cpu
Normal file
3
files/rpms/n-cpu
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Stuff for diablo volumes
|
||||||
|
iscsi-initiator-utils
|
||||||
|
lvm2
|
1
files/rpms/n-novnc
Normal file
1
files/rpms/n-novnc
Normal file
@ -0,0 +1 @@
|
|||||||
|
numpy
|
2
files/rpms/n-vol
Normal file
2
files/rpms/n-vol
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
lvm2
|
||||||
|
scsi-target-utils
|
39
files/rpms/nova
Normal file
39
files/rpms/nova
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
MySQL-python
|
||||||
|
curl
|
||||||
|
dnsmasq-utils # for dhcp_release
|
||||||
|
ebtables
|
||||||
|
gawk
|
||||||
|
iptables
|
||||||
|
iputils
|
||||||
|
kpartx
|
||||||
|
kvm
|
||||||
|
libvirt-bin # NOPRIME
|
||||||
|
libvirt-python
|
||||||
|
libxml2-python
|
||||||
|
m2crypto
|
||||||
|
mysql-server # NOPRIME
|
||||||
|
parted
|
||||||
|
python-boto
|
||||||
|
python-carrot
|
||||||
|
python-cheetah
|
||||||
|
python-eventlet
|
||||||
|
python-feedparser
|
||||||
|
python-gflags
|
||||||
|
python-greenlet
|
||||||
|
python-iso8601
|
||||||
|
python-kombu
|
||||||
|
python-lockfile
|
||||||
|
python-migrate
|
||||||
|
python-mox
|
||||||
|
python-netaddr
|
||||||
|
python-paramiko
|
||||||
|
python-paste
|
||||||
|
python-paste-deploy
|
||||||
|
python-routes
|
||||||
|
python-sqlalchemy
|
||||||
|
python-suds
|
||||||
|
python-tempita
|
||||||
|
rabbitmq-server # NOPRIME
|
||||||
|
sqlite
|
||||||
|
sudo
|
||||||
|
vconfig
|
18
files/rpms/swift
Normal file
18
files/rpms/swift
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
curl
|
||||||
|
gcc
|
||||||
|
memcached # NOPRIME
|
||||||
|
python-configobj
|
||||||
|
python-coverage
|
||||||
|
python-devel
|
||||||
|
python-eventlet
|
||||||
|
python-greenlet
|
||||||
|
python-netifaces
|
||||||
|
python-nose
|
||||||
|
python-paste-deploy
|
||||||
|
python-setuptools
|
||||||
|
python-simplejson
|
||||||
|
python-webob
|
||||||
|
pyxattr
|
||||||
|
sqlite
|
||||||
|
xfsprogs
|
||||||
|
xinetd
|
21
functions
21
functions
@ -298,21 +298,42 @@ function pip_install {
|
|||||||
# Service wrapper to restart services
|
# Service wrapper to restart services
|
||||||
# restart_service service-name
|
# restart_service service-name
|
||||||
function restart_service() {
|
function restart_service() {
|
||||||
|
if [[ -z "$os_PACKAGE" ]]; then
|
||||||
|
GetOSVersion
|
||||||
|
fi
|
||||||
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
sudo /usr/sbin/service $1 restart
|
sudo /usr/sbin/service $1 restart
|
||||||
|
else
|
||||||
|
sudo /sbin/service $1 restart
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Service wrapper to start services
|
# Service wrapper to start services
|
||||||
# start_service service-name
|
# start_service service-name
|
||||||
function start_service() {
|
function start_service() {
|
||||||
|
if [[ -z "$os_PACKAGE" ]]; then
|
||||||
|
GetOSVersion
|
||||||
|
fi
|
||||||
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
sudo /usr/sbin/service $1 start
|
sudo /usr/sbin/service $1 start
|
||||||
|
else
|
||||||
|
sudo /sbin/service $1 start
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Service wrapper to stop services
|
# Service wrapper to stop services
|
||||||
# stop_service service-name
|
# stop_service service-name
|
||||||
function stop_service() {
|
function stop_service() {
|
||||||
|
if [[ -z "$os_PACKAGE" ]]; then
|
||||||
|
GetOSVersion
|
||||||
|
fi
|
||||||
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
sudo /usr/sbin/service $1 stop
|
sudo /usr/sbin/service $1 stop
|
||||||
|
else
|
||||||
|
sudo /sbin/service $1 stop
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
169
stack.sh
169
stack.sh
@ -32,6 +32,9 @@ GetOSVersion
|
|||||||
if [[ "$os_VENDOR" =~ (Ubuntu) ]]; then
|
if [[ "$os_VENDOR" =~ (Ubuntu) ]]; then
|
||||||
# 'Everyone' refers to Ubuntu releases by the code name adjective
|
# 'Everyone' refers to Ubuntu releases by the code name adjective
|
||||||
DISTRO=$os_CODENAME
|
DISTRO=$os_CODENAME
|
||||||
|
elif [[ "$os_VENDOR" =~ (Fedora) ]]; then
|
||||||
|
# For Fedora, just use 'f' and the release
|
||||||
|
DISTRO="f$os_RELEASE"
|
||||||
else
|
else
|
||||||
# Catch-all for now is Vendor + Release + Update
|
# Catch-all for now is Vendor + Release + Update
|
||||||
DISTRO="$os_VENDOR-$os_RELEASE.$os_UPDATE"
|
DISTRO="$os_VENDOR-$os_RELEASE.$os_UPDATE"
|
||||||
@ -72,7 +75,7 @@ if [[ ! -r $TOP_DIR/stackrc ]]; then
|
|||||||
echo "ERROR: missing $TOP_DIR/stackrc - did you grab more than just stack.sh?"
|
echo "ERROR: missing $TOP_DIR/stackrc - did you grab more than just stack.sh?"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
source ./stackrc
|
source $TOP_DIR/stackrc
|
||||||
|
|
||||||
# Destination path for installation ``DEST``
|
# Destination path for installation ``DEST``
|
||||||
DEST=${DEST:-/opt/stack}
|
DEST=${DEST:-/opt/stack}
|
||||||
@ -83,14 +86,21 @@ DEST=${DEST:-/opt/stack}
|
|||||||
|
|
||||||
# Warn users who aren't on an explicitly supported distro, but allow them to
|
# Warn users who aren't on an explicitly supported distro, but allow them to
|
||||||
# override check and attempt installation with ``FORCE=yes ./stack``
|
# override check and attempt installation with ``FORCE=yes ./stack``
|
||||||
if [[ ! ${DISTRO} =~ (oneiric|precise) ]]; then
|
if [[ ! ${DISTRO} =~ (oneiric|precise|f16) ]]; then
|
||||||
echo "WARNING: this script has only been tested on oneiric and precise"
|
echo "WARNING: this script has been tested on oneiric, precise and f16"
|
||||||
if [[ "$FORCE" != "yes" ]]; then
|
if [[ "$FORCE" != "yes" ]]; then
|
||||||
echo "If you wish to run this script anyway run with FORCE=yes"
|
echo "If you wish to run this script anyway run with FORCE=yes"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set the paths of certain binaries
|
||||||
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
|
NOVA_ROOTWRAP=/usr/local/bin/nova-rootwrap
|
||||||
|
else
|
||||||
|
NOVA_ROOTWRAP=/usr/bin/nova-rootwrap
|
||||||
|
fi
|
||||||
|
|
||||||
# stack.sh keeps the list of ``apt`` and ``pip`` dependencies in external
|
# stack.sh keeps the list of ``apt`` and ``pip`` dependencies in external
|
||||||
# files, along with config templates and other useful files. You can find these
|
# files, along with config templates and other useful files. You can find these
|
||||||
# in the ``files`` directory (next to this script). We will reference this
|
# in the ``files`` directory (next to this script). We will reference this
|
||||||
@ -122,11 +132,16 @@ if [[ $EUID -eq 0 ]]; then
|
|||||||
|
|
||||||
# since this script runs as a normal user, we need to give that user
|
# since this script runs as a normal user, we need to give that user
|
||||||
# ability to run sudo
|
# ability to run sudo
|
||||||
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
dpkg -l sudo || apt_get update && install_package sudo
|
dpkg -l sudo || apt_get update && install_package sudo
|
||||||
|
STACK_GROUP=sudo
|
||||||
|
else
|
||||||
|
rpm -qa | grep sudo || install_package sudo
|
||||||
|
STACK_GROUP=wheel
|
||||||
|
fi
|
||||||
if ! getent passwd stack >/dev/null; then
|
if ! getent passwd stack >/dev/null; then
|
||||||
echo "Creating a user called stack"
|
echo "Creating a user called stack"
|
||||||
useradd -U -G sudo -s /bin/bash -d $DEST -m stack
|
useradd -U -G $STACK_GROUP -s /bin/bash -d $DEST -m stack
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Giving stack user passwordless sudo priviledges"
|
echo "Giving stack user passwordless sudo priviledges"
|
||||||
@ -148,7 +163,12 @@ if [[ $EUID -eq 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
# We're not root, make sure sudo is available
|
# We're not root, make sure sudo is available
|
||||||
dpkg -l sudo || die "Sudo is required. Re-run stack.sh as root ONE TIME ONLY to set up sudo."
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
|
CHECK_SUDO_CMD="dpkg -l sudo"
|
||||||
|
else
|
||||||
|
CHECK_SUDO_CMD="rpm -q sudo"
|
||||||
|
fi
|
||||||
|
$CHECK_SUDO_CMD || die "Sudo is required. Re-run stack.sh as root ONE TIME ONLY to set up sudo."
|
||||||
|
|
||||||
# UEC images /etc/sudoers does not have a '#includedir'. add one.
|
# UEC images /etc/sudoers does not have a '#includedir'. add one.
|
||||||
sudo grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers ||
|
sudo grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers ||
|
||||||
@ -163,7 +183,7 @@ else
|
|||||||
|
|
||||||
# Set up the rootwrap sudoers
|
# Set up the rootwrap sudoers
|
||||||
TEMPFILE=`mktemp`
|
TEMPFILE=`mktemp`
|
||||||
echo "$USER ALL=(root) NOPASSWD: /usr/local/bin/nova-rootwrap" >$TEMPFILE
|
echo "$USER ALL=(root) NOPASSWD: $NOVA_ROOTWRAP" >$TEMPFILE
|
||||||
chmod 0440 $TEMPFILE
|
chmod 0440 $TEMPFILE
|
||||||
sudo chown root:root $TEMPFILE
|
sudo chown root:root $TEMPFILE
|
||||||
sudo mv $TEMPFILE /etc/sudoers.d/nova-rootwrap
|
sudo mv $TEMPFILE /etc/sudoers.d/nova-rootwrap
|
||||||
@ -549,6 +569,8 @@ fi
|
|||||||
# - ``# NOPRIME`` defers installation to be performed later in stack.sh
|
# - ``# NOPRIME`` defers installation to be performed later in stack.sh
|
||||||
# - ``# dist:DISTRO`` or ``dist:DISTRO1,DISTRO2`` limits the selection
|
# - ``# dist:DISTRO`` or ``dist:DISTRO1,DISTRO2`` limits the selection
|
||||||
# of the package to the distros listed. The distro names are case insensitive.
|
# of the package to the distros listed. The distro names are case insensitive.
|
||||||
|
#
|
||||||
|
# get_packages dir
|
||||||
function get_packages() {
|
function get_packages() {
|
||||||
local package_dir=$1
|
local package_dir=$1
|
||||||
local file_to_parse
|
local file_to_parse
|
||||||
@ -558,7 +580,8 @@ function get_packages() {
|
|||||||
echo "No package directory supplied"
|
echo "No package directory supplied"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
for service in general ${ENABLED_SERVICES//,/ }; do # Allow individual services to specify dependencies
|
for service in general ${ENABLED_SERVICES//,/ }; do
|
||||||
|
# Allow individual services to specify dependencies
|
||||||
if [[ -e ${package_dir}/${service} ]]; then
|
if [[ -e ${package_dir}/${service} ]]; then
|
||||||
file_to_parse="${file_to_parse} $service"
|
file_to_parse="${file_to_parse} $service"
|
||||||
fi
|
fi
|
||||||
@ -604,9 +627,13 @@ function get_packages() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# install apt requirements
|
# install package requirements
|
||||||
apt_get update
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
install_package $(get_packages $FILES/apts)
|
apt_get update
|
||||||
|
install_package $(get_packages $FILES/apts)
|
||||||
|
else
|
||||||
|
install_package $(get_packages $FILES/rpms)
|
||||||
|
fi
|
||||||
|
|
||||||
# install python requirements
|
# install python requirements
|
||||||
pip_install $(get_packages $FILES/pips | sort -u)
|
pip_install $(get_packages $FILES/pips | sort -u)
|
||||||
@ -722,6 +749,10 @@ if is_service_enabled rabbit; then
|
|||||||
install_package rabbitmq-server > "$tfile" 2>&1
|
install_package rabbitmq-server > "$tfile" 2>&1
|
||||||
cat "$tfile"
|
cat "$tfile"
|
||||||
rm -f "$tfile"
|
rm -f "$tfile"
|
||||||
|
if [[ "$os_PACKAGE" = "rpm" ]]; then
|
||||||
|
# RPM doesn't start the service
|
||||||
|
restart_service rabbitmq-server
|
||||||
|
fi
|
||||||
# change the rabbit password since the default is "guest"
|
# change the rabbit password since the default is "guest"
|
||||||
sudo rabbitmqctl change_password guest $RABBIT_PASSWORD
|
sudo rabbitmqctl change_password guest $RABBIT_PASSWORD
|
||||||
fi
|
fi
|
||||||
@ -732,6 +763,7 @@ fi
|
|||||||
|
|
||||||
if is_service_enabled mysql; then
|
if is_service_enabled mysql; then
|
||||||
|
|
||||||
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
# Seed configuration with mysql password so that apt-get install doesn't
|
# Seed configuration with mysql password so that apt-get install doesn't
|
||||||
# prompt us for a password upon install.
|
# prompt us for a password upon install.
|
||||||
cat <<MYSQL_PRESEED | sudo debconf-set-selections
|
cat <<MYSQL_PRESEED | sudo debconf-set-selections
|
||||||
@ -739,6 +771,7 @@ mysql-server-5.1 mysql-server/root_password password $MYSQL_PASSWORD
|
|||||||
mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASSWORD
|
mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASSWORD
|
||||||
mysql-server-5.1 mysql-server/start_on_boot boolean true
|
mysql-server-5.1 mysql-server/start_on_boot boolean true
|
||||||
MYSQL_PRESEED
|
MYSQL_PRESEED
|
||||||
|
fi
|
||||||
|
|
||||||
# while ``.my.cnf`` is not needed for openstack to function, it is useful
|
# while ``.my.cnf`` is not needed for openstack to function, it is useful
|
||||||
# as it allows you to access the mysql databases via ``mysql nova`` instead
|
# as it allows you to access the mysql databases via ``mysql nova`` instead
|
||||||
@ -755,12 +788,25 @@ EOF
|
|||||||
|
|
||||||
# Install and start mysql-server
|
# Install and start mysql-server
|
||||||
install_package mysql-server
|
install_package mysql-server
|
||||||
|
if [[ "$os_PACKAGE" = "rpm" ]]; then
|
||||||
|
# RPM doesn't start the service
|
||||||
|
start_service mysqld
|
||||||
|
# Set the root password - only works the first time
|
||||||
|
sudo mysqladmin -u root password $MYSQL_PASSWORD || true
|
||||||
|
fi
|
||||||
# Update the DB to give user ‘$MYSQL_USER’@’%’ full control of the all databases:
|
# Update the DB to give user ‘$MYSQL_USER’@’%’ full control of the all databases:
|
||||||
sudo mysql -uroot -p$MYSQL_PASSWORD -h127.0.0.1 -e "GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER'@'%' identified by '$MYSQL_PASSWORD';"
|
sudo mysql -uroot -p$MYSQL_PASSWORD -h127.0.0.1 -e "GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER'@'%' identified by '$MYSQL_PASSWORD';"
|
||||||
|
|
||||||
# Edit /etc/mysql/my.cnf to change ‘bind-address’ from localhost (127.0.0.1) to any (0.0.0.0) and restart the mysql service:
|
# Edit /etc/mysql/my.cnf to change ‘bind-address’ from localhost (127.0.0.1) to any (0.0.0.0) and restart the mysql service:
|
||||||
sudo sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
restart_service mysql
|
MY_CNF=/etc/mysql/my.cnf
|
||||||
|
MYSQL=mysql
|
||||||
|
else
|
||||||
|
MY_CNF=/etc/my.cnf
|
||||||
|
MYSQL=mysqld
|
||||||
|
fi
|
||||||
|
sudo sed -i 's/127.0.0.1/0.0.0.0/g' $MY_CNF
|
||||||
|
restart_service $MYSQL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$SCREEN_HARDSTATUS" ]; then
|
if [ -z "$SCREEN_HARDSTATUS" ]; then
|
||||||
@ -820,10 +866,6 @@ screen -r stack -X hardstatus alwayslastline "$SCREEN_HARDSTATUS"
|
|||||||
|
|
||||||
if is_service_enabled horizon; then
|
if is_service_enabled horizon; then
|
||||||
|
|
||||||
# Install apache2, which is NOPRIME'd
|
|
||||||
install_package apache2 libapache2-mod-wsgi
|
|
||||||
|
|
||||||
|
|
||||||
# Remove stale session database.
|
# Remove stale session database.
|
||||||
rm -f $HORIZON_DIR/openstack_dashboard/local/dashboard_openstack.sqlite3
|
rm -f $HORIZON_DIR/openstack_dashboard/local/dashboard_openstack.sqlite3
|
||||||
|
|
||||||
@ -835,18 +877,38 @@ if is_service_enabled horizon; then
|
|||||||
# users). The user system is external (keystone).
|
# users). The user system is external (keystone).
|
||||||
cd $HORIZON_DIR
|
cd $HORIZON_DIR
|
||||||
python manage.py syncdb
|
python manage.py syncdb
|
||||||
|
cd $TOP_DIR
|
||||||
|
|
||||||
# create an empty directory that apache uses as docroot
|
# create an empty directory that apache uses as docroot
|
||||||
sudo mkdir -p $HORIZON_DIR/.blackhole
|
sudo mkdir -p $HORIZON_DIR/.blackhole
|
||||||
|
|
||||||
## Configure apache's 000-default to run horizon
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
sudo cp $FILES/000-default.template /etc/apache2/sites-enabled/000-default
|
# Install apache2, which is NOPRIME'd
|
||||||
sudo sed -e "
|
APACHE_NAME=apache2
|
||||||
|
APACHE_CONF=sites-available/horizon
|
||||||
|
install_package apache2 libapache2-mod-wsgi
|
||||||
|
# Clean up the old config name
|
||||||
|
sudo rm -f /etc/apache2/sites-enabled/000-default
|
||||||
|
# Be a good citizen and use the distro tools here
|
||||||
|
sudo touch /etc/$APACHE_NAME/$APACHE_CONF
|
||||||
|
sudo a2ensite horizon
|
||||||
|
else
|
||||||
|
# Install httpd, which is NOPRIME'd
|
||||||
|
APACHE_NAME=httpd
|
||||||
|
APACHE_CONF=conf.d/horizon.conf
|
||||||
|
sudo rm -f /etc/httpd/conf.d/000-*
|
||||||
|
install_package httpd mod_wsgi
|
||||||
|
sudo sed '/^Listen/s/^.*$/Listen 0.0.0.0:80/' -i /etc/httpd/conf/httpd.conf
|
||||||
|
fi
|
||||||
|
## Configure apache to run horizon
|
||||||
|
sudo sh -c "sed -e \"
|
||||||
s,%USER%,$APACHE_USER,g;
|
s,%USER%,$APACHE_USER,g;
|
||||||
s,%GROUP%,$APACHE_GROUP,g;
|
s,%GROUP%,$APACHE_GROUP,g;
|
||||||
s,%HORIZON_DIR%,$HORIZON_DIR,g;
|
s,%HORIZON_DIR%,$HORIZON_DIR,g;
|
||||||
" -i /etc/apache2/sites-enabled/000-default
|
s,%APACHE_NAME%,$APACHE_NAME,g;
|
||||||
restart_service apache2
|
s,%DEST%,$DEST,g;
|
||||||
|
\" $FILES/apache-horizon.template >/etc/$APACHE_NAME/$APACHE_CONF"
|
||||||
|
restart_service $APACHE_NAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -921,8 +983,13 @@ if is_service_enabled q-svc; then
|
|||||||
if [[ "$Q_PLUGIN" = "openvswitch" ]]; then
|
if [[ "$Q_PLUGIN" = "openvswitch" ]]; then
|
||||||
# Install deps
|
# Install deps
|
||||||
# FIXME add to files/apts/quantum, but don't install if not needed!
|
# FIXME add to files/apts/quantum, but don't install if not needed!
|
||||||
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
kernel_version=`cat /proc/version | cut -d " " -f3`
|
kernel_version=`cat /proc/version | cut -d " " -f3`
|
||||||
install_package openvswitch-switch openvswitch-datapath-dkms linux-headers-$kernel_version
|
install_package openvswitch-switch openvswitch-datapath-dkms linux-headers-$kernel_version
|
||||||
|
else
|
||||||
|
### FIXME(dtroyer): Find RPMs for OpenVSwitch
|
||||||
|
echo "OpenVSwitch packages need to be located"
|
||||||
|
fi
|
||||||
# Create database for the plugin/agent
|
# Create database for the plugin/agent
|
||||||
if is_service_enabled mysql; then
|
if is_service_enabled mysql; then
|
||||||
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS ovs_quantum;'
|
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS ovs_quantum;'
|
||||||
@ -1044,7 +1111,12 @@ if is_service_enabled n-cpu; then
|
|||||||
|
|
||||||
# Virtualization Configuration
|
# Virtualization Configuration
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
install_package libvirt-bin
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
|
LIBVIRT_PKG_NAME=libvirt-bin
|
||||||
|
else
|
||||||
|
LIBVIRT_PKG_NAME=libvirt
|
||||||
|
fi
|
||||||
|
install_package $LIBVIRT_PKG_NAME
|
||||||
|
|
||||||
# Force IP forwarding on, just on case
|
# Force IP forwarding on, just on case
|
||||||
sudo sysctl -w net.ipv4.ip_forward=1
|
sudo sysctl -w net.ipv4.ip_forward=1
|
||||||
@ -1067,6 +1139,7 @@ if is_service_enabled n-cpu; then
|
|||||||
# splitting a system into many smaller parts. LXC uses cgroups and chroot
|
# splitting a system into many smaller parts. LXC uses cgroups and chroot
|
||||||
# to simulate multiple systems.
|
# to simulate multiple systems.
|
||||||
if [[ "$LIBVIRT_TYPE" == "lxc" ]]; then
|
if [[ "$LIBVIRT_TYPE" == "lxc" ]]; then
|
||||||
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
if [[ "$DISTRO" > natty ]]; then
|
if [[ "$DISTRO" > natty ]]; then
|
||||||
install_package cgroup-lite
|
install_package cgroup-lite
|
||||||
else
|
else
|
||||||
@ -1079,15 +1152,37 @@ if is_service_enabled n-cpu; then
|
|||||||
sudo mount /cgroup
|
sudo mount /cgroup
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
### FIXME(dtroyer): figure this out
|
||||||
|
echo "RPM-based cgroup not implemented yet"
|
||||||
|
yum_install libcgroup-tools
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
|
LIBVIRT_DAEMON=libvirt-bin
|
||||||
|
else
|
||||||
|
# http://wiki.libvirt.org/page/SSHPolicyKitSetup
|
||||||
|
if ! grep ^libvirtd: /etc/group >/dev/null; then
|
||||||
|
sudo groupadd libvirtd
|
||||||
|
fi
|
||||||
|
sudo bash -c 'cat <<EOF >/etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
|
||||||
|
[libvirt Management Access]
|
||||||
|
Identity=unix-group:libvirtd
|
||||||
|
Action=org.libvirt.unix.manage
|
||||||
|
ResultAny=yes
|
||||||
|
ResultInactive=yes
|
||||||
|
ResultActive=yes
|
||||||
|
EOF'
|
||||||
|
LIBVIRT_DAEMON=libvirtd
|
||||||
|
fi
|
||||||
# The user that nova runs as needs to be member of libvirtd group otherwise
|
# The user that nova runs as needs to be member of libvirtd group otherwise
|
||||||
# nova-compute will be unable to use libvirt.
|
# nova-compute will be unable to use libvirt.
|
||||||
sudo usermod -a -G libvirtd `whoami`
|
sudo usermod -a -G libvirtd `whoami`
|
||||||
# libvirt detects various settings on startup, as we potentially changed
|
# libvirt detects various settings on startup, as we potentially changed
|
||||||
# the system configuration (modules, filesystems), we need to restart
|
# the system configuration (modules, filesystems), we need to restart
|
||||||
# libvirt to detect those changes.
|
# libvirt to detect those changes.
|
||||||
restart_service libvirt-bin
|
restart_service $LIBVIRT_DAEMON
|
||||||
|
|
||||||
|
|
||||||
# Instance Storage
|
# Instance Storage
|
||||||
@ -1202,7 +1297,11 @@ if is_service_enabled swift; then
|
|||||||
s/%USER%/$USER/;
|
s/%USER%/$USER/;
|
||||||
s,%SWIFT_DATA_DIR%,$SWIFT_DATA_DIR,;
|
s,%SWIFT_DATA_DIR%,$SWIFT_DATA_DIR,;
|
||||||
" $FILES/swift/rsyncd.conf | sudo tee /etc/rsyncd.conf
|
" $FILES/swift/rsyncd.conf | sudo tee /etc/rsyncd.conf
|
||||||
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
sudo sed -i '/^RSYNC_ENABLE=false/ { s/false/true/ }' /etc/default/rsync
|
sudo sed -i '/^RSYNC_ENABLE=false/ { s/false/true/ }' /etc/default/rsync
|
||||||
|
else
|
||||||
|
sudo sed -i '/disable *= *yes/ { s/yes/no/ }' /etc/xinetd.d/rsync
|
||||||
|
fi
|
||||||
|
|
||||||
# By default Swift will be installed with the tempauth middleware
|
# By default Swift will be installed with the tempauth middleware
|
||||||
# which has some default username and password if you have
|
# which has some default username and password if you have
|
||||||
@ -1267,10 +1366,10 @@ if is_service_enabled swift; then
|
|||||||
swift_log_dir=${SWIFT_DATA_DIR}/logs
|
swift_log_dir=${SWIFT_DATA_DIR}/logs
|
||||||
rm -rf ${swift_log_dir}
|
rm -rf ${swift_log_dir}
|
||||||
mkdir -p ${swift_log_dir}/hourly
|
mkdir -p ${swift_log_dir}/hourly
|
||||||
sudo chown -R syslog:adm ${swift_log_dir}
|
sudo chown -R $USER:adm ${swift_log_dir}
|
||||||
sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
|
sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
|
||||||
tee /etc/rsyslog.d/10-swift.conf
|
tee /etc/rsyslog.d/10-swift.conf
|
||||||
sudo restart rsyslog
|
restart_service rsyslog
|
||||||
|
|
||||||
# This is where we create three different rings for swift with
|
# This is where we create three different rings for swift with
|
||||||
# different object servers binding on different ports.
|
# different object servers binding on different ports.
|
||||||
@ -1304,10 +1403,12 @@ if is_service_enabled swift; then
|
|||||||
|
|
||||||
} && popd >/dev/null
|
} && popd >/dev/null
|
||||||
|
|
||||||
sudo chmod +x /usr/local/bin/swift-*
|
|
||||||
|
|
||||||
# We then can start rsync.
|
# We then can start rsync.
|
||||||
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
sudo /etc/init.d/rsync restart || :
|
sudo /etc/init.d/rsync restart || :
|
||||||
|
else
|
||||||
|
sudo systemctl start xinetd.service
|
||||||
|
fi
|
||||||
|
|
||||||
# First spawn all the swift services then kill the
|
# First spawn all the swift services then kill the
|
||||||
# proxy service so we can run it in foreground in screen.
|
# proxy service so we can run it in foreground in screen.
|
||||||
@ -1332,9 +1433,6 @@ if is_service_enabled n-vol; then
|
|||||||
#
|
#
|
||||||
# By default, the backing file is 2G in size, and is stored in /opt/stack.
|
# By default, the backing file is 2G in size, and is stored in /opt/stack.
|
||||||
|
|
||||||
# install the package
|
|
||||||
install_package tgt
|
|
||||||
|
|
||||||
if ! sudo vgs $VOLUME_GROUP; then
|
if ! sudo vgs $VOLUME_GROUP; then
|
||||||
VOLUME_BACKING_FILE=${VOLUME_BACKING_FILE:-$DEST/nova-volumes-backing-file}
|
VOLUME_BACKING_FILE=${VOLUME_BACKING_FILE:-$DEST/nova-volumes-backing-file}
|
||||||
VOLUME_BACKING_FILE_SIZE=${VOLUME_BACKING_FILE_SIZE:-2052M}
|
VOLUME_BACKING_FILE_SIZE=${VOLUME_BACKING_FILE_SIZE:-2052M}
|
||||||
@ -1357,10 +1455,15 @@ if is_service_enabled n-vol; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$os_PACKAGE" = "deb" ]]; then
|
||||||
# tgt in oneiric doesn't restart properly if tgtd isn't running
|
# tgt in oneiric doesn't restart properly if tgtd isn't running
|
||||||
# do it in two steps
|
# do it in two steps
|
||||||
sudo stop tgt || true
|
sudo stop tgt || true
|
||||||
sudo start tgt
|
sudo start tgt
|
||||||
|
else
|
||||||
|
# bypass redirection to systemctl during restart
|
||||||
|
sudo /sbin/service --skip-redirect tgtd restart
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
NOVA_CONF=nova.conf
|
NOVA_CONF=nova.conf
|
||||||
@ -1377,7 +1480,7 @@ add_nova_opt "[DEFAULT]"
|
|||||||
add_nova_opt "verbose=True"
|
add_nova_opt "verbose=True"
|
||||||
add_nova_opt "auth_strategy=keystone"
|
add_nova_opt "auth_strategy=keystone"
|
||||||
add_nova_opt "allow_resize_to_same_host=True"
|
add_nova_opt "allow_resize_to_same_host=True"
|
||||||
add_nova_opt "root_helper=sudo /usr/local/bin/nova-rootwrap"
|
add_nova_opt "root_helper=sudo $NOVA_ROOTWRAP"
|
||||||
add_nova_opt "compute_scheduler_driver=$SCHEDULER"
|
add_nova_opt "compute_scheduler_driver=$SCHEDULER"
|
||||||
add_nova_opt "dhcpbridge_flagfile=$NOVA_CONF_DIR/$NOVA_CONF"
|
add_nova_opt "dhcpbridge_flagfile=$NOVA_CONF_DIR/$NOVA_CONF"
|
||||||
add_nova_opt "fixed_range=$FIXED_RANGE"
|
add_nova_opt "fixed_range=$FIXED_RANGE"
|
||||||
@ -1661,7 +1764,7 @@ screen_it n-sch "cd $NOVA_DIR && $NOVA_DIR/bin/nova-scheduler"
|
|||||||
screen_it n-novnc "cd $NOVNC_DIR && ./utils/nova-novncproxy --config-file $NOVA_CONF_DIR/$NOVA_CONF --web ."
|
screen_it n-novnc "cd $NOVNC_DIR && ./utils/nova-novncproxy --config-file $NOVA_CONF_DIR/$NOVA_CONF --web ."
|
||||||
screen_it n-xvnc "cd $NOVA_DIR && ./bin/nova-xvpvncproxy --config-file $NOVA_CONF_DIR/$NOVA_CONF"
|
screen_it n-xvnc "cd $NOVA_DIR && ./bin/nova-xvpvncproxy --config-file $NOVA_CONF_DIR/$NOVA_CONF"
|
||||||
screen_it n-cauth "cd $NOVA_DIR && ./bin/nova-consoleauth"
|
screen_it n-cauth "cd $NOVA_DIR && ./bin/nova-consoleauth"
|
||||||
screen_it horizon "cd $HORIZON_DIR && sudo tail -f /var/log/apache2/error.log"
|
screen_it horizon "cd $HORIZON_DIR && sudo tail -f /var/log/$APACHE_NAME/horizon_error.log"
|
||||||
screen_it swift "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-proxy-server ${SWIFT_CONFIG_DIR}/proxy-server.conf -v"
|
screen_it swift "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-proxy-server ${SWIFT_CONFIG_DIR}/proxy-server.conf -v"
|
||||||
|
|
||||||
# Starting the nova-objectstore only if swift service is not enabled.
|
# Starting the nova-objectstore only if swift service is not enabled.
|
||||||
|
@ -49,7 +49,7 @@ if is_service_enabled n-vol; then
|
|||||||
echo "iSCSI target cleanup needed:"
|
echo "iSCSI target cleanup needed:"
|
||||||
echo "$TARGETS"
|
echo "$TARGETS"
|
||||||
fi
|
fi
|
||||||
sudo stop tgt
|
stop_service tgt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$UNSTACK_ALL" ]]; then
|
if [[ -n "$UNSTACK_ALL" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user