|
|
|
@ -43,6 +43,40 @@ fi
|
|
|
|
|
# Keep track of the current devstack directory.
|
|
|
|
|
TOP_DIR=$(cd $(dirname "$0") && pwd)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Settings
|
|
|
|
|
# ========
|
|
|
|
|
|
|
|
|
|
# This script is customizable through setting environment variables. If you
|
|
|
|
|
# want to override a setting you can either::
|
|
|
|
|
#
|
|
|
|
|
# export MYSQL_PASSWORD=anothersecret
|
|
|
|
|
# ./stack.sh
|
|
|
|
|
#
|
|
|
|
|
# You can also pass options on a single line ``MYSQL_PASSWORD=simple ./stack.sh``
|
|
|
|
|
#
|
|
|
|
|
# Additionally, you can put any local variables into a ``localrc`` file, like::
|
|
|
|
|
#
|
|
|
|
|
# MYSQL_PASSWORD=anothersecret
|
|
|
|
|
# MYSQL_USER=hellaroot
|
|
|
|
|
#
|
|
|
|
|
# We try to have sensible defaults, so you should be able to run ``./stack.sh``
|
|
|
|
|
# in most cases.
|
|
|
|
|
#
|
|
|
|
|
# We our settings from ``stackrc``. This file is distributed with devstack and
|
|
|
|
|
# contains locations for what repositories to use. If you want to use other
|
|
|
|
|
# repositories and branches, you can add your own settings with another file
|
|
|
|
|
# called ``localrc``
|
|
|
|
|
#
|
|
|
|
|
# If ``localrc`` exists, then ``stackrc`` will load those settings. This is
|
|
|
|
|
# useful for changing a branch or repostiory to test other versions. Also you
|
|
|
|
|
# can store your other settings like **MYSQL_PASSWORD** or **ADMIN_PASSWORD** instead
|
|
|
|
|
# of letting devstack generate random ones for you.
|
|
|
|
|
source ./stackrc
|
|
|
|
|
|
|
|
|
|
# Destination path for installation ``DEST``
|
|
|
|
|
DEST=${DEST:-/opt/stack}
|
|
|
|
|
|
|
|
|
|
# OpenStack is designed to be run as a regular user (Dashboard will fail to run
|
|
|
|
|
# as root, since apache refused to startup serve content from root user). If
|
|
|
|
|
# stack.sh is run as root, it automatically creates a stack user with
|
|
|
|
@ -60,7 +94,7 @@ if [[ $EUID -eq 0 ]]; then
|
|
|
|
|
|
|
|
|
|
if ! getent passwd stack >/dev/null; then
|
|
|
|
|
echo "Creating a user called stack"
|
|
|
|
|
useradd -U -G sudo -s /bin/bash -m stack
|
|
|
|
|
useradd -U -G sudo -s /bin/bash -d $DEST -m stack
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "Giving stack user passwordless sudo priviledges"
|
|
|
|
@ -71,7 +105,7 @@ if [[ $EUID -eq 0 ]]; then
|
|
|
|
|
> /etc/sudoers.d/50_stack_sh )
|
|
|
|
|
|
|
|
|
|
echo "Copying files to stack user"
|
|
|
|
|
STACK_DIR="/home/stack/${PWD##*/}"
|
|
|
|
|
STACK_DIR="$DEST/${PWD##*/}"
|
|
|
|
|
cp -r -f "$PWD" "$STACK_DIR"
|
|
|
|
|
chown -R stack "$STACK_DIR"
|
|
|
|
|
if [[ "$SHELL_AFTER_RUN" != "no" ]]; then
|
|
|
|
@ -82,40 +116,6 @@ if [[ $EUID -eq 0 ]]; then
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Settings
|
|
|
|
|
# ========
|
|
|
|
|
|
|
|
|
|
# This script is customizable through setting environment variables. If you
|
|
|
|
|
# want to override a setting you can either::
|
|
|
|
|
#
|
|
|
|
|
# export MYSQL_PASSWORD=anothersecret
|
|
|
|
|
# ./stack.sh
|
|
|
|
|
#
|
|
|
|
|
# You can also pass options on a single line ``MYSQL_PASSWORD=simple ./stack.sh``
|
|
|
|
|
#
|
|
|
|
|
# Additionally, you can put any local variables into a ``localrc`` file, like::
|
|
|
|
|
#
|
|
|
|
|
# MYSQL_PASSWORD=anothersecret
|
|
|
|
|
# MYSQL_USER=hellaroot
|
|
|
|
|
#
|
|
|
|
|
# We try to have sensible defaults, so you should be able to run ``./stack.sh``
|
|
|
|
|
# in most cases.
|
|
|
|
|
#
|
|
|
|
|
# We our settings from ``stackrc``. This file is distributed with devstack and
|
|
|
|
|
# contains locations for what repositories to use. If you want to use other
|
|
|
|
|
# repositories and branches, you can add your own settings with another file
|
|
|
|
|
# called ``localrc``
|
|
|
|
|
#
|
|
|
|
|
# If ``localrc`` exists, then ``stackrc`` will load those settings. This is
|
|
|
|
|
# useful for changing a branch or repostiory to test other versions. Also you
|
|
|
|
|
# can store your other settings like **MYSQL_PASSWORD** or **ADMIN_PASSWORD** instead
|
|
|
|
|
# of letting devstack generate random ones for you.
|
|
|
|
|
source ./stackrc
|
|
|
|
|
|
|
|
|
|
# Destination path for installation ``DEST``
|
|
|
|
|
DEST=${DEST:-/opt/stack}
|
|
|
|
|
|
|
|
|
|
# Set the destination directories for openstack projects
|
|
|
|
|
NOVA_DIR=$DEST/nova
|
|
|
|
|
DASH_DIR=$DEST/dash
|
|
|
|
|