| ... | ... |
@@ -1,7 +1,16 @@ |
| 1 |
-# -*- mode: Shell-script -*- |
|
| 2 | 1 |
# functions - Common functions used by DevStack components |
| 3 | 2 |
# |
| 4 |
-# ENABLED_SERVICES is used by is_service_enabled() |
|
| 3 |
+# The following variables are assumed to be defined by certain functions: |
|
| 4 |
+# ``DISTRO`` |
|
| 5 |
+# ``ENABLED_SERVICES`` |
|
| 6 |
+# ``EROR_ON_CLONE`` |
|
| 7 |
+# ``FILES`` |
|
| 8 |
+# ``GLANCE_HOSTPORT`` |
|
| 9 |
+# ``OFFLINE`` |
|
| 10 |
+# ``PIP_DOWNLOAD_CACHE`` |
|
| 11 |
+# ``RECLONE`` |
|
| 12 |
+# ``TRACK_DEPENDS`` |
|
| 13 |
+# ``http_proxy``, ``https_proxy``, ``no_proxy`` |
|
| 5 | 14 |
|
| 6 | 15 |
|
| 7 | 16 |
# Save trace setting |
| ... | ... |
@@ -9,9 +18,9 @@ XTRACE=$(set +o | grep xtrace) |
| 9 | 9 |
set +o xtrace |
| 10 | 10 |
|
| 11 | 11 |
|
| 12 |
-# Exit 0 if address is in network or 1 if |
|
| 13 |
-# address is not in network or netaddr library |
|
| 14 |
-# is not installed. |
|
| 12 |
+# Exit 0 if address is in network or 1 if address is not in |
|
| 13 |
+# network or netaddr library is not installed. |
|
| 14 |
+# address_in_net ip-address ip-range |
|
| 15 | 15 |
function address_in_net() {
|
| 16 | 16 |
python -c " |
| 17 | 17 |
import netaddr |
| ... | ... |
@@ -21,7 +30,8 @@ sys.exit(netaddr.IPAddress('$1') not in netaddr.IPNetwork('$2'))
|
| 21 | 21 |
} |
| 22 | 22 |
|
| 23 | 23 |
|
| 24 |
-# apt-get wrapper to set arguments correctly |
|
| 24 |
+# Wrapper for ``apt-get`` to set cache and proxy environment variables |
|
| 25 |
+# Uses globals ``OFFLINE``, ``*_proxy` |
|
| 25 | 26 |
# apt_get operation package [package ...] |
| 26 | 27 |
function apt_get() {
|
| 27 | 28 |
[[ "$OFFLINE" = "True" || -z "$@" ]] && return |
| ... | ... |
@@ -88,15 +98,16 @@ function get_field() {
|
| 88 | 88 |
|
| 89 | 89 |
|
| 90 | 90 |
# get_packages() collects a list of package names of any type from the |
| 91 |
-# prerequisite files in ``files/{apts|pips}``. The list is intended
|
|
| 92 |
-# to be passed to a package installer such as apt or pip. |
|
| 91 |
+# prerequisite files in ``files/{apts|rpms}``. The list is intended
|
|
| 92 |
+# to be passed to a package installer such as apt or yum. |
|
| 93 | 93 |
# |
| 94 |
-# Only packages required for the services in ENABLED_SERVICES will be |
|
| 94 |
+# Only packages required for the services in ``ENABLED_SERVICES`` will be |
|
| 95 | 95 |
# included. Two bits of metadata are recognized in the prerequisite files: |
| 96 | 96 |
# - ``# NOPRIME`` defers installation to be performed later in stack.sh |
| 97 | 97 |
# - ``# dist:DISTRO`` or ``dist:DISTRO1,DISTRO2`` limits the selection |
| 98 | 98 |
# of the package to the distros listed. The distro names are case insensitive. |
| 99 | 99 |
# |
| 100 |
+# Uses globals ``DISTRO``, ``ENABLED_SERVICES`` |
|
| 100 | 101 |
# get_packages dir |
| 101 | 102 |
function get_packages() {
|
| 102 | 103 |
local package_dir=$1 |
| ... | ... |
@@ -241,6 +252,7 @@ GetOSVersion() {
|
| 241 | 241 |
} |
| 242 | 242 |
|
| 243 | 243 |
# git update using reference as a branch. |
| 244 |
+# git_update_branch ref |
|
| 244 | 245 |
function git_update_branch() {
|
| 245 | 246 |
|
| 246 | 247 |
GIT_BRANCH=$1 |
| ... | ... |
@@ -254,6 +266,7 @@ function git_update_branch() {
|
| 254 | 254 |
|
| 255 | 255 |
# git update using reference as a tag. Be careful editing source at that repo |
| 256 | 256 |
# as working copy will be in a detached mode |
| 257 |
+# git_update_tag ref |
|
| 257 | 258 |
function git_update_tag() {
|
| 258 | 259 |
|
| 259 | 260 |
GIT_TAG=$1 |
| ... | ... |
@@ -289,6 +302,7 @@ function GetDistro() {
|
| 289 | 289 |
# Set global RECLONE=yes to simulate a clone when dest-dir exists |
| 290 | 290 |
# Set global ERROR_ON_CLONE=True to abort execution with an error if the git repo |
| 291 | 291 |
# does not exist (default is False, meaning the repo will be cloned). |
| 292 |
+# Uses global ``OFFLINE`` |
|
| 292 | 293 |
# git_clone remote dest-dir branch |
| 293 | 294 |
function git_clone {
|
| 294 | 295 |
[[ "$OFFLINE" = "True" ]] && return |
| ... | ... |
@@ -394,16 +408,20 @@ $option = $value |
| 394 | 394 |
|
| 395 | 395 |
|
| 396 | 396 |
# is_service_enabled() checks if the service(s) specified as arguments are |
| 397 |
-# enabled by the user in **ENABLED_SERVICES**. |
|
| 397 |
+# enabled by the user in ``ENABLED_SERVICES``. |
|
| 398 | 398 |
# |
| 399 |
-# If there are multiple services specified as arguments the test performs a |
|
| 400 |
-# boolean OR or if any of the services specified on the command line |
|
| 401 |
-# return true. |
|
| 399 |
+# Multiple services specified as arguments are ``OR``'ed together; the test |
|
| 400 |
+# is a short-circuit boolean, i.e it returns on the first match. |
|
| 402 | 401 |
# |
| 403 |
-# There is a special cases for some 'catch-all' services:: |
|
| 402 |
+# There are special cases for some 'catch-all' services:: |
|
| 404 | 403 |
# **nova** returns true if any service enabled start with **n-** |
| 404 |
+# **cinder** returns true if any service enabled start with **c-** |
|
| 405 |
+# **ceilometer** returns true if any service enabled start with **ceilometer** |
|
| 405 | 406 |
# **glance** returns true if any service enabled start with **g-** |
| 406 | 407 |
# **quantum** returns true if any service enabled start with **q-** |
| 408 |
+# |
|
| 409 |
+# Uses global ``ENABLED_SERVICES`` |
|
| 410 |
+# is_service_enabled service [service ...] |
|
| 407 | 411 |
function is_service_enabled() {
|
| 408 | 412 |
services=$@ |
| 409 | 413 |
for service in ${services}; do
|
| ... | ... |
@@ -417,7 +435,9 @@ function is_service_enabled() {
|
| 417 | 417 |
return 1 |
| 418 | 418 |
} |
| 419 | 419 |
|
| 420 |
-# remove extra commas from the input string (ENABLED_SERVICES) |
|
| 420 |
+ |
|
| 421 |
+# remove extra commas from the input string (i.e. ``ENABLED_SERVICES``) |
|
| 422 |
+# _cleanup_service_list service-list |
|
| 421 | 423 |
function _cleanup_service_list () {
|
| 422 | 424 |
echo "$1" | sed -e ' |
| 423 | 425 |
s/,,/,/g; |
| ... | ... |
@@ -426,15 +446,17 @@ function _cleanup_service_list () {
|
| 426 | 426 |
' |
| 427 | 427 |
} |
| 428 | 428 |
|
| 429 |
+ |
|
| 429 | 430 |
# enable_service() adds the services passed as argument to the |
| 430 |
-# **ENABLED_SERVICES** list, if they are not already present. |
|
| 431 |
+# ``ENABLED_SERVICES`` list, if they are not already present. |
|
| 431 | 432 |
# |
| 432 | 433 |
# For example: |
| 433 |
-# |
|
| 434 | 434 |
# enable_service n-vol |
| 435 | 435 |
# |
| 436 | 436 |
# This function does not know about the special cases |
| 437 | 437 |
# for nova, glance, and quantum built into is_service_enabled(). |
| 438 |
+# Uses global ``ENABLED_SERVICES`` |
|
| 439 |
+# enable_service service [service ...] |
|
| 438 | 440 |
function enable_service() {
|
| 439 | 441 |
local tmpsvcs="${ENABLED_SERVICES}"
|
| 440 | 442 |
for service in $@; do |
| ... | ... |
@@ -446,15 +468,17 @@ function enable_service() {
|
| 446 | 446 |
disable_negated_services |
| 447 | 447 |
} |
| 448 | 448 |
|
| 449 |
+ |
|
| 449 | 450 |
# disable_service() removes the services passed as argument to the |
| 450 |
-# **ENABLED_SERVICES** list, if they are present. |
|
| 451 |
+# ``ENABLED_SERVICES`` list, if they are present. |
|
| 451 | 452 |
# |
| 452 | 453 |
# For example: |
| 453 |
-# |
|
| 454 | 454 |
# disable_service n-vol |
| 455 | 455 |
# |
| 456 | 456 |
# This function does not know about the special cases |
| 457 | 457 |
# for nova, glance, and quantum built into is_service_enabled(). |
| 458 |
+# Uses global ``ENABLED_SERVICES`` |
|
| 459 |
+# disable_service service [service ...] |
|
| 458 | 460 |
function disable_service() {
|
| 459 | 461 |
local tmpsvcs=",${ENABLED_SERVICES},"
|
| 460 | 462 |
local service |
| ... | ... |
@@ -466,17 +490,22 @@ function disable_service() {
|
| 466 | 466 |
ENABLED_SERVICES=$(_cleanup_service_list "$tmpsvcs") |
| 467 | 467 |
} |
| 468 | 468 |
|
| 469 |
+ |
|
| 469 | 470 |
# disable_all_services() removes all current services |
| 470 |
-# from **ENABLED_SERVICES** to reset the configuration |
|
| 471 |
+# from ``ENABLED_SERVICES`` to reset the configuration |
|
| 471 | 472 |
# before a minimal installation |
| 473 |
+# Uses global ``ENABLED_SERVICES`` |
|
| 474 |
+# disable_all_services |
|
| 472 | 475 |
function disable_all_services() {
|
| 473 | 476 |
ENABLED_SERVICES="" |
| 474 | 477 |
} |
| 475 | 478 |
|
| 476 |
-# We are looking for services with a - at the beginning to force |
|
| 477 |
-# excluding those services. For example if you want to install all the default |
|
| 478 |
-# services but not nova-volume (n-vol) you can have this set in your localrc : |
|
| 479 |
+ |
|
| 480 |
+# Remove all services starting with '-'. For example, to install all default |
|
| 481 |
+# services except nova-volume (n-vol) set in ``localrc``: |
|
| 479 | 482 |
# ENABLED_SERVICES+=",-n-vol" |
| 483 |
+# Uses global ``ENABLED_SERVICES`` |
|
| 484 |
+# disable_negated_services |
|
| 480 | 485 |
function disable_negated_services() {
|
| 481 | 486 |
local tmpsvcs="${ENABLED_SERVICES}"
|
| 482 | 487 |
local service |
| ... | ... |
@@ -488,6 +517,7 @@ function disable_negated_services() {
|
| 488 | 488 |
ENABLED_SERVICES=$(_cleanup_service_list "$tmpsvcs") |
| 489 | 489 |
} |
| 490 | 490 |
|
| 491 |
+ |
|
| 491 | 492 |
# Distro-agnostic package installer |
| 492 | 493 |
# install_package package [package ...] |
| 493 | 494 |
function install_package() {
|
| ... | ... |
@@ -513,7 +543,8 @@ function is_set() {
|
| 513 | 513 |
} |
| 514 | 514 |
|
| 515 | 515 |
|
| 516 |
-# pip install wrapper to set cache and proxy environment variables |
|
| 516 |
+# Wrapper for ``pip install`` to set cache and proxy environment variables |
|
| 517 |
+# Uses globals ``OFFLINE``, ``PIP_DOWNLOAD_CACHE``, ``TRACK_DEPENDES``, ``*_proxy` |
|
| 517 | 518 |
# pip_install package [package ...] |
| 518 | 519 |
function pip_install {
|
| 519 | 520 |
[[ "$OFFLINE" = "True" || -z "$@" ]] && return |
| ... | ... |
@@ -554,8 +585,9 @@ function restart_service() {
|
| 554 | 554 |
} |
| 555 | 555 |
|
| 556 | 556 |
|
| 557 |
-# pip install the dependencies of the package before we do the setup.py |
|
| 558 |
-# develop, so that pip and not distutils process the dependency chain |
|
| 557 |
+# ``pip install`` the dependencies of the package before ``setup.py develop`` |
|
| 558 |
+# so pip and not distutils processes the dependency chain |
|
| 559 |
+# Uses globals ``TRACK_DEPENDES``, ``*_proxy` |
|
| 559 | 560 |
# setup_develop directory |
| 560 | 561 |
function setup_develop() {
|
| 561 | 562 |
if [[ $TRACK_DEPENDS = True ]] ; then |
| ... | ... |
@@ -606,7 +638,9 @@ function stop_service() {
|
| 606 | 606 |
|
| 607 | 607 |
|
| 608 | 608 |
# Normalize config values to True or False |
| 609 |
-# VAR=`trueorfalse default-value test-value` |
|
| 609 |
+# Accepts as False: 0 no false False FALSE |
|
| 610 |
+# Accepts as True: 1 yes true True TRUE |
|
| 611 |
+# VAR=$(trueorfalse default-value test-value) |
|
| 610 | 612 |
function trueorfalse() {
|
| 611 | 613 |
local default=$1 |
| 612 | 614 |
local testval=$2 |
| ... | ... |
@@ -620,8 +654,8 @@ function trueorfalse() {
|
| 620 | 620 |
|
| 621 | 621 |
# Retrieve an image from a URL and upload into Glance |
| 622 | 622 |
# Uses the following variables: |
| 623 |
-# **FILES** must be set to the cache dir |
|
| 624 |
-# **GLANCE_HOSTPORT** |
|
| 623 |
+# ``FILES`` must be set to the cache dir |
|
| 624 |
+# ``GLANCE_HOSTPORT`` |
|
| 625 | 625 |
# upload_image image-url glance-token |
| 626 | 626 |
function upload_image() {
|
| 627 | 627 |
local image_url=$1 |
| ... | ... |
@@ -717,7 +751,8 @@ function upload_image() {
|
| 717 | 717 |
} |
| 718 | 718 |
|
| 719 | 719 |
|
| 720 |
-# yum wrapper to set arguments correctly |
|
| 720 |
+# Wrapper for ``yum`` to set proxy environment variables |
|
| 721 |
+# Uses globals ``OFFLINE``, ``*_proxy` |
|
| 721 | 722 |
# yum_install package [package ...] |
| 722 | 723 |
function yum_install() {
|
| 723 | 724 |
[[ "$OFFLINE" = "True" ]] && return |
| ... | ... |
@@ -731,3 +766,8 @@ function yum_install() {
|
| 731 | 731 |
|
| 732 | 732 |
# Restore xtrace |
| 733 | 733 |
$XTRACE |
| 734 |
+ |
|
| 735 |
+ |
|
| 736 |
+# Local variables: |
|
| 737 |
+# -*- mode: Shell-script -*- |
|
| 738 |
+# End: |
|
| 734 | 739 |
\ No newline at end of file |
| ... | ... |
@@ -1,8 +1,9 @@ |
| 1 | 1 |
#!/usr/bin/env bash |
| 2 | 2 |
|
| 3 | 3 |
# ``stack.sh`` is an opinionated OpenStack developer installation. It |
| 4 |
-# installs and configures various combinations of **Glance**, **Horizon**, |
|
| 5 |
-# **Keystone**, **Nova**, **Quantum**, **Heat** and **Swift** |
|
| 4 |
+# installs and configures various combinations of **Ceilometer**, **Cinder**, |
|
| 5 |
+# **Glance**, **Heat**, **Horizon**, **Keystone**, **Nova**, **Quantum** |
|
| 6 |
+# and **Swift** |
|
| 6 | 7 |
|
| 7 | 8 |
# This script allows you to specify configuration options of what git |
| 8 | 9 |
# repositories to use, enabled services, network configuration and various |
| ... | ... |
@@ -10,14 +11,14 @@ |
| 10 | 10 |
# shared settings for common resources (mysql, rabbitmq) and build a multi-node |
| 11 | 11 |
# developer install. |
| 12 | 12 |
|
| 13 |
-# To keep this script simple we assume you are running on an **Ubuntu 11.10 |
|
| 14 |
-# Oneiric** or **Ubuntu 12.04 Precise** machine. It should work in a VM or |
|
| 15 |
-# physical server. Additionally we put the list of ``apt`` and ``pip`` |
|
| 16 |
-# dependencies and other configuration files in this repo. So start by |
|
| 17 |
-# grabbing this script and the dependencies. |
|
| 13 |
+# To keep this script simple we assume you are running on a recent **Ubuntu** |
|
| 14 |
+# (11.10 Oneiric or 12.04 Precise) or **Fedora** (F16 or F17) machine. It |
|
| 15 |
+# should work in a VM or physical server. Additionally we put the list of |
|
| 16 |
+# ``apt`` and ``rpm`` dependencies and other configuration files in this repo. |
|
| 18 | 17 |
|
| 19 | 18 |
# Learn more and get the most recent version at http://devstack.org |
| 20 | 19 |
|
| 20 |
+ |
|
| 21 | 21 |
# Keep track of the devstack directory |
| 22 | 22 |
TOP_DIR=$(cd $(dirname "$0") && pwd) |
| 23 | 23 |
|
| ... | ... |
@@ -47,25 +48,31 @@ GetDistro |
| 47 | 47 |
# MYSQL_USER=hellaroot |
| 48 | 48 |
# |
| 49 | 49 |
# We try to have sensible defaults, so you should be able to run ``./stack.sh`` |
| 50 |
-# in most cases. |
|
| 50 |
+# in most cases. ``localrc`` is not distributed with DevStack and will never |
|
| 51 |
+# be overwritten by a DevStack update. |
|
| 51 | 52 |
# |
| 52 | 53 |
# DevStack distributes ``stackrc`` which contains locations for the OpenStack |
| 53 | 54 |
# repositories and branches to configure. ``stackrc`` sources ``localrc`` to |
| 54 |
-# allow you to safely override those settings without being overwritten |
|
| 55 |
-# when updating DevStack. |
|
| 55 |
+# allow you to safely override those settings. |
|
| 56 |
+ |
|
| 56 | 57 |
if [[ ! -r $TOP_DIR/stackrc ]]; then |
| 57 | 58 |
echo "ERROR: missing $TOP_DIR/stackrc - did you grab more than just stack.sh?" |
| 58 | 59 |
exit 1 |
| 59 | 60 |
fi |
| 60 | 61 |
source $TOP_DIR/stackrc |
| 61 | 62 |
|
| 62 |
-# HTTP and HTTPS proxy servers are supported via the usual environment variables |
|
| 63 |
-# ``http_proxy`` and ``https_proxy``. Additionally if you would like to access |
|
| 64 |
-# to specific server directly and not through the proxy server, you can use |
|
| 65 |
-# ``no_proxy`` environment variable. They can be set in ``localrc`` if necessary |
|
| 66 |
-# or on the command line:: |
|
| 63 |
+ |
|
| 64 |
+# Proxy Settings |
|
| 65 |
+# -------------- |
|
| 66 |
+ |
|
| 67 |
+# HTTP and HTTPS proxy servers are supported via the usual environment variables [1] |
|
| 68 |
+# ``http_proxy``, ``https_proxy`` and ``no_proxy``. They can be set in |
|
| 69 |
+# ``localrc`` if necessary or on the command line:: |
|
| 70 |
+# |
|
| 71 |
+# [1] http://www.w3.org/Daemon/User/Proxies/ProxyClients.html |
|
| 67 | 72 |
# |
| 68 | 73 |
# http_proxy=http://proxy.example.com:3128/ no_proxy=repo.example.net ./stack.sh |
| 74 |
+ |
|
| 69 | 75 |
if [[ -n "$http_proxy" ]]; then |
| 70 | 76 |
export http_proxy=$http_proxy |
| 71 | 77 |
fi |
| ... | ... |
@@ -98,6 +105,7 @@ if [[ ! ${DISTRO} =~ (oneiric|precise|quantal|f16|f17) ]]; then
|
| 98 | 98 |
fi |
| 99 | 99 |
fi |
| 100 | 100 |
|
| 101 |
+# Disallow qpid on oneiric |
|
| 101 | 102 |
if [ "${DISTRO}" = "oneiric" ] && is_service_enabled qpid ; then
|
| 102 | 103 |
# Qpid was introduced in precise |
| 103 | 104 |
echo "You must use Ubuntu Precise or newer for Qpid support." |
| ... | ... |
@@ -114,17 +122,15 @@ fi |
| 114 | 114 |
# ``stack.sh`` keeps function libraries here |
| 115 | 115 |
# Make sure ``$TOP_DIR/lib`` directory is present |
| 116 | 116 |
if [ ! -d $TOP_DIR/lib ]; then |
| 117 |
- echo "ERROR: missing devstack/lib - did you grab more than just stack.sh?" |
|
| 117 |
+ echo "ERROR: missing devstack/lib" |
|
| 118 | 118 |
exit 1 |
| 119 | 119 |
fi |
| 120 | 120 |
|
| 121 |
-# stack.sh keeps the list of ``apt`` and ``pip`` dependencies in external |
|
| 122 |
-# files, along with config templates and other useful files. You can find these |
|
| 123 |
-# in the ``files`` directory (next to this script). We will reference this |
|
| 124 |
-# directory using the ``FILES`` variable in this script. |
|
| 121 |
+# ``stack.sh`` keeps the list of ``apt`` and ``rpm`` dependencies and config |
|
| 122 |
+# templates and other useful files in the ``files`` subdirectory |
|
| 125 | 123 |
FILES=$TOP_DIR/files |
| 126 | 124 |
if [ ! -d $FILES ]; then |
| 127 |
- echo "ERROR: missing devstack/files - did you grab more than just stack.sh?" |
|
| 125 |
+ echo "ERROR: missing devstack/files" |
|
| 128 | 126 |
exit 1 |
| 129 | 127 |
fi |
| 130 | 128 |
|
| ... | ... |
@@ -132,7 +138,7 @@ fi |
| 132 | 132 |
if type -p screen >/dev/null && screen -ls | egrep -q "[0-9].stack"; then |
| 133 | 133 |
echo "You are already running a stack.sh session." |
| 134 | 134 |
echo "To rejoin this session type 'screen -x stack'." |
| 135 |
- echo "To destroy this session, kill the running screen." |
|
| 135 |
+ echo "To destroy this session, type './unstack.sh'." |
|
| 136 | 136 |
exit 1 |
| 137 | 137 |
fi |
| 138 | 138 |
|
| ... | ... |
@@ -142,8 +148,12 @@ if is_service_enabled cinder && is_service_enabled n-vol; then |
| 142 | 142 |
exit 1 |
| 143 | 143 |
fi |
| 144 | 144 |
|
| 145 |
-# OpenStack is designed to be run as a regular user (Horizon will fail to run |
|
| 146 |
-# as root, since apache refused to startup serve content from root user). If |
|
| 145 |
+ |
|
| 146 |
+# root Access |
|
| 147 |
+# ----------- |
|
| 148 |
+ |
|
| 149 |
+# OpenStack is designed to be run as a non-root user; Horizon will fail to run |
|
| 150 |
+# as **root** since Apache will not serve content from **root** user). If |
|
| 147 | 151 |
# ``stack.sh`` is run as **root**, it automatically creates a **stack** user with |
| 148 | 152 |
# sudo privileges and runs as that user. |
| 149 | 153 |
|
| ... | ... |
@@ -153,8 +163,7 @@ if [[ $EUID -eq 0 ]]; then |
| 153 | 153 |
echo "In $ROOTSLEEP seconds, we will create a user 'stack' and run as that user" |
| 154 | 154 |
sleep $ROOTSLEEP |
| 155 | 155 |
|
| 156 |
- # since this script runs as a normal user, we need to give that user |
|
| 157 |
- # ability to run sudo |
|
| 156 |
+ # Give the non-root user the ability to run as **root** via ``sudo`` |
|
| 158 | 157 |
if [[ "$os_PACKAGE" = "deb" ]]; then |
| 159 | 158 |
dpkg -l sudo || apt_get update && install_package sudo |
| 160 | 159 |
else |
| ... | ... |
@@ -170,7 +179,7 @@ if [[ $EUID -eq 0 ]]; then |
| 170 | 170 |
fi |
| 171 | 171 |
|
| 172 | 172 |
echo "Giving stack user passwordless sudo priviledges" |
| 173 |
- # some uec images sudoers does not have a '#includedir'. add one. |
|
| 173 |
+ # UEC images ``/etc/sudoers`` does not have a ``#includedir``, add one |
|
| 174 | 174 |
grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers || |
| 175 | 175 |
echo "#includedir /etc/sudoers.d" >> /etc/sudoers |
| 176 | 176 |
( umask 226 && echo "stack ALL=(ALL) NOPASSWD:ALL" \ |
| ... | ... |
@@ -187,7 +196,7 @@ if [[ $EUID -eq 0 ]]; then |
| 187 | 187 |
fi |
| 188 | 188 |
exit 1 |
| 189 | 189 |
else |
| 190 |
- # We're not root, make sure sudo is available |
|
| 190 |
+ # We're not **root**, make sure ``sudo`` is available |
|
| 191 | 191 |
if [[ "$os_PACKAGE" = "deb" ]]; then |
| 192 | 192 |
CHECK_SUDO_CMD="dpkg -l sudo" |
| 193 | 193 |
else |
| ... | ... |
@@ -195,7 +204,7 @@ else |
| 195 | 195 |
fi |
| 196 | 196 |
$CHECK_SUDO_CMD || die "Sudo is required. Re-run stack.sh as root ONE TIME ONLY to set up sudo." |
| 197 | 197 |
|
| 198 |
- # UEC images /etc/sudoers does not have a '#includedir'. add one. |
|
| 198 |
+ # UEC images ``/etc/sudoers`` does not have a ``#includedir``, add one |
|
| 199 | 199 |
sudo grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers || |
| 200 | 200 |
echo "#includedir /etc/sudoers.d" | sudo tee -a /etc/sudoers |
| 201 | 201 |
|
| ... | ... |
@@ -219,14 +228,14 @@ if [ ! -w $DEST ]; then |
| 219 | 219 |
sudo chown `whoami` $DEST |
| 220 | 220 |
fi |
| 221 | 221 |
|
| 222 |
-# Set True to configure ``stack.sh`` to run cleanly without Internet access. |
|
| 223 |
-# ``stack.sh`` must have been previously run with Internet access to install |
|
| 224 |
-# prerequisites and initialize ``$DEST``. |
|
| 222 |
+# Set ``OFFLINE`` to ``True`` to configure ``stack.sh`` to run cleanly without |
|
| 223 |
+# Internet access. ``stack.sh`` must have been previously run with Internet |
|
| 224 |
+# access to install prerequisites and fetch repositories. |
|
| 225 | 225 |
OFFLINE=`trueorfalse False $OFFLINE` |
| 226 | 226 |
|
| 227 |
-# Set True to configure ``stack.sh`` to exit with an error code if it is asked |
|
| 228 |
-# to clone any git repositories. If devstack is used in a testing environment, |
|
| 229 |
-# this may be used to ensure that the correct code is being tested. |
|
| 227 |
+# Set ``ERROR_ON_CLONE`` to ``True`` to configure ``stack.sh`` to exit if |
|
| 228 |
+# the destination git repository does not exist during the ``git_clone`` |
|
| 229 |
+# operation. |
|
| 230 | 230 |
ERROR_ON_CLONE=`trueorfalse False $ERROR_ON_CLONE` |
| 231 | 231 |
|
| 232 | 232 |
# Destination path for service data |
| ... | ... |
@@ -235,15 +244,15 @@ sudo mkdir -p $DATA_DIR |
| 235 | 235 |
sudo chown `whoami` $DATA_DIR |
| 236 | 236 |
|
| 237 | 237 |
|
| 238 |
-# Projects |
|
| 239 |
-# -------- |
|
| 238 |
+# Configure Projects |
|
| 239 |
+# ================== |
|
| 240 | 240 |
|
| 241 | 241 |
# Get project function libraries |
| 242 | 242 |
source $TOP_DIR/lib/cinder |
| 243 | 243 |
source $TOP_DIR/lib/ceilometer |
| 244 | 244 |
source $TOP_DIR/lib/heat |
| 245 | 245 |
|
| 246 |
-# Set the destination directories for openstack projects |
|
| 246 |
+# Set the destination directories for OpenStack projects |
|
| 247 | 247 |
NOVA_DIR=$DEST/nova |
| 248 | 248 |
HORIZON_DIR=$DEST/horizon |
| 249 | 249 |
GLANCE_DIR=$DEST/glance |
| ... | ... |
@@ -273,17 +282,19 @@ Q_AUTH_STRATEGY=${Q_AUTH_STRATEGY:-keystone}
|
| 273 | 273 |
# Use namespace or not |
| 274 | 274 |
Q_USE_NAMESPACE=${Q_USE_NAMESPACE:-True}
|
| 275 | 275 |
|
| 276 |
-# Name of the lvm volume group to use/create for iscsi volumes |
|
| 276 |
+# Name of the LVM volume group to use/create for iscsi volumes |
|
| 277 | 277 |
VOLUME_GROUP=${VOLUME_GROUP:-stack-volumes}
|
| 278 | 278 |
VOLUME_NAME_PREFIX=${VOLUME_NAME_PREFIX:-volume-}
|
| 279 | 279 |
INSTANCE_NAME_PREFIX=${INSTANCE_NAME_PREFIX:-instance-}
|
| 280 | 280 |
|
| 281 |
-# Nova supports pluggable schedulers. ``FilterScheduler`` should work in most |
|
| 282 |
-# cases. |
|
| 281 |
+# Nova supports pluggable schedulers. The default ``FilterScheduler`` |
|
| 282 |
+# should work in most cases. |
|
| 283 | 283 |
SCHEDULER=${SCHEDULER:-nova.scheduler.filter_scheduler.FilterScheduler}
|
| 284 | 284 |
|
| 285 | 285 |
# Set fixed and floating range here so we can make sure not to use addresses |
| 286 |
-# from either range when attempting to guess the ip to use for the host |
|
| 286 |
+# from either range when attempting to guess the IP to use for the host. |
|
| 287 |
+# Note that setting FIXED_RANGE may be necessary when running DevStack |
|
| 288 |
+# in an OpenStack cloud that uses eith of these address ranges internally. |
|
| 287 | 289 |
FIXED_RANGE=${FIXED_RANGE:-10.0.0.0/24}
|
| 288 | 290 |
FLOATING_RANGE=${FLOATING_RANGE:-172.24.4.224/28}
|
| 289 | 291 |
|
| ... | ... |
@@ -294,10 +305,12 @@ if [ -z "$HOST_IP" -o "$HOST_IP" == "dhcp" ]; then |
| 294 | 294 |
HOST_IP="" |
| 295 | 295 |
HOST_IPS=`LC_ALL=C ip -f inet addr show ${HOST_IP_IFACE} | awk '/inet/ {split($2,parts,"/"); print parts[1]}'`
|
| 296 | 296 |
for IP in $HOST_IPS; do |
| 297 |
- # Attempt to filter out ip addresses that are part of the fixed and |
|
| 298 |
- # floating range. Note that this method only works if the 'netaddr' |
|
| 297 |
+ # Attempt to filter out IP addresses that are part of the fixed and |
|
| 298 |
+ # floating range. Note that this method only works if the ``netaddr`` |
|
| 299 | 299 |
# python library is installed. If it is not installed, an error |
| 300 |
- # will be printed and the first ip from the interface will be used. |
|
| 300 |
+ # will be printed and the first IP from the interface will be used. |
|
| 301 |
+ # If that is not correct set ``HOST_IP`` in ``localrc`` to the correct |
|
| 302 |
+ # address. |
|
| 301 | 303 |
if ! (address_in_net $IP $FIXED_RANGE || address_in_net $IP $FLOATING_RANGE); then |
| 302 | 304 |
HOST_IP=$IP |
| 303 | 305 |
break; |
| ... | ... |
@@ -318,7 +331,7 @@ SYSLOG=`trueorfalse False $SYSLOG` |
| 318 | 318 |
SYSLOG_HOST=${SYSLOG_HOST:-$HOST_IP}
|
| 319 | 319 |
SYSLOG_PORT=${SYSLOG_PORT:-516}
|
| 320 | 320 |
|
| 321 |
-# Use color for logging output |
|
| 321 |
+# Use color for logging output (only available if syslog is not used) |
|
| 322 | 322 |
LOG_COLOR=`trueorfalse True $LOG_COLOR` |
| 323 | 323 |
|
| 324 | 324 |
# Service startup timeout |
| ... | ... |
@@ -374,7 +387,7 @@ function read_password {
|
| 374 | 374 |
|
| 375 | 375 |
if [ "$VIRT_DRIVER" = 'xenserver' ]; then |
| 376 | 376 |
PUBLIC_INTERFACE_DEFAULT=eth3 |
| 377 |
- # allow build_domU.sh to specify the flat network bridge via kernel args |
|
| 377 |
+ # Allow ``build_domU.sh`` to specify the flat network bridge via kernel args |
|
| 378 | 378 |
FLAT_NETWORK_BRIDGE_DEFAULT=$(grep -o 'flat_network_bridge=[[:alnum:]]*' /proc/cmdline | cut -d= -f 2 | sort -u) |
| 379 | 379 |
GUEST_INTERFACE_DEFAULT=eth1 |
| 380 | 380 |
else |
| ... | ... |
@@ -396,19 +409,19 @@ VLAN_INTERFACE=${VLAN_INTERFACE:-$GUEST_INTERFACE_DEFAULT}
|
| 396 | 396 |
TEST_FLOATING_POOL=${TEST_FLOATING_POOL:-test}
|
| 397 | 397 |
TEST_FLOATING_RANGE=${TEST_FLOATING_RANGE:-192.168.253.0/29}
|
| 398 | 398 |
|
| 399 |
-# **MULTI_HOST** is a mode where each compute node runs its own network node. This |
|
| 399 |
+# ``MULTI_HOST`` is a mode where each compute node runs its own network node. This |
|
| 400 | 400 |
# allows network operations and routing for a VM to occur on the server that is |
| 401 | 401 |
# running the VM - removing a SPOF and bandwidth bottleneck. |
| 402 | 402 |
MULTI_HOST=`trueorfalse False $MULTI_HOST` |
| 403 | 403 |
|
| 404 |
-# If you are using FlatDHCP on multiple hosts, set the ``FLAT_INTERFACE`` |
|
| 405 |
-# variable but make sure that the interface doesn't already have an |
|
| 406 |
-# ip or you risk breaking things. |
|
| 404 |
+# If you are using the FlatDHCP network mode on multiple hosts, set the |
|
| 405 |
+# ``FLAT_INTERFACE`` variable but make sure that the interface doesn't already |
|
| 406 |
+# have an IP or you risk breaking things. |
|
| 407 | 407 |
# |
| 408 | 408 |
# **DHCP Warning**: If your flat interface device uses DHCP, there will be a |
| 409 | 409 |
# hiccup while the network is moved from the flat interface to the flat network |
| 410 | 410 |
# bridge. This will happen when you launch your first instance. Upon launch |
| 411 |
-# you will lose all connectivity to the node, and the vm launch will probably |
|
| 411 |
+# you will lose all connectivity to the node, and the VM launch will probably |
|
| 412 | 412 |
# fail. |
| 413 | 413 |
# |
| 414 | 414 |
# If you are running on a single node and don't need to access the VMs from |
| ... | ... |
@@ -431,6 +444,7 @@ FLAT_INTERFACE=${FLAT_INTERFACE:-$GUEST_INTERFACE_DEFAULT}
|
| 431 | 431 |
# |
| 432 | 432 |
# With Quantum networking the NET_MAN variable is ignored. |
| 433 | 433 |
|
| 434 |
+ |
|
| 434 | 435 |
# MySQL & (RabbitMQ or Qpid) |
| 435 | 436 |
# -------------------------- |
| 436 | 437 |
|
| ... | ... |
@@ -446,7 +460,7 @@ MYSQL_HOST=${MYSQL_HOST:-localhost}
|
| 446 | 446 |
MYSQL_USER=${MYSQL_USER:-root}
|
| 447 | 447 |
read_password MYSQL_PASSWORD "ENTER A PASSWORD TO USE FOR MYSQL." |
| 448 | 448 |
|
| 449 |
-# NOTE: Don't specify /db in this string so we can use it for multiple services |
|
| 449 |
+# NOTE: Don't specify ``/db`` in this string so we can use it for multiple services |
|
| 450 | 450 |
BASE_SQL_CONN=${BASE_SQL_CONN:-mysql://$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST}
|
| 451 | 451 |
|
| 452 | 452 |
# Rabbit connection info |
| ... | ... |
@@ -455,6 +469,10 @@ if is_service_enabled rabbit; then |
| 455 | 455 |
read_password RABBIT_PASSWORD "ENTER A PASSWORD TO USE FOR RABBIT." |
| 456 | 456 |
fi |
| 457 | 457 |
|
| 458 |
+ |
|
| 459 |
+# Glance |
|
| 460 |
+# ------ |
|
| 461 |
+ |
|
| 458 | 462 |
# Glance connection info. Note the port must be specified. |
| 459 | 463 |
GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$SERVICE_HOST:9292}
|
| 460 | 464 |
|
| ... | ... |
@@ -464,19 +482,17 @@ GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$SERVICE_HOST:9292}
|
| 464 | 464 |
|
| 465 | 465 |
# TODO: add logging to different location. |
| 466 | 466 |
|
| 467 |
-# By default the location of swift drives and objects is located inside |
|
| 468 |
-# the swift source directory. SWIFT_DATA_DIR variable allow you to redefine |
|
| 469 |
-# this. |
|
| 467 |
+# Set ``SWIFT_DATA_DIR`` to the location of swift drives and objects. |
|
| 468 |
+# Default is the common DevStack data directory. |
|
| 470 | 469 |
SWIFT_DATA_DIR=${SWIFT_DATA_DIR:-${DEST}/data/swift}
|
| 471 | 470 |
|
| 472 |
-# We are going to have the configuration files inside the source |
|
| 473 |
-# directory, change SWIFT_CONFIG_DIR if you want to adjust that. |
|
| 471 |
+# Set ``SWIFT_CONFIG_DIR`` to the location of the configuration files. |
|
| 472 |
+# Default is ``/etc/swift``. |
|
| 474 | 473 |
SWIFT_CONFIG_DIR=${SWIFT_CONFIG_DIR:-/etc/swift}
|
| 475 | 474 |
|
| 476 | 475 |
# DevStack will create a loop-back disk formatted as XFS to store the |
| 477 |
-# swift data. By default the disk size is 1 gigabyte. The variable |
|
| 478 |
-# SWIFT_LOOPBACK_DISK_SIZE specified in bytes allow you to change |
|
| 479 |
-# that. |
|
| 476 |
+# swift data. Set ``SWIFT_LOOPBACK_DISK_SIZE`` to the disk size in bytes. |
|
| 477 |
+# Default is 1 gigabyte. |
|
| 480 | 478 |
SWIFT_LOOPBACK_DISK_SIZE=${SWIFT_LOOPBACK_DISK_SIZE:-1000000}
|
| 481 | 479 |
|
| 482 | 480 |
# The ring uses a configurable number of bits from a path’s MD5 hash as |
| ... | ... |
@@ -489,7 +505,7 @@ SWIFT_LOOPBACK_DISK_SIZE=${SWIFT_LOOPBACK_DISK_SIZE:-1000000}
|
| 489 | 489 |
# By default we define 9 for the partition count (which mean 512). |
| 490 | 490 |
SWIFT_PARTITION_POWER_SIZE=${SWIFT_PARTITION_POWER_SIZE:-9}
|
| 491 | 491 |
|
| 492 |
-# This variable allows you to configure how many replicas you want to be |
|
| 492 |
+# Set ``SWIFT_REPLICAS`` to configure how many replicas are to be |
|
| 493 | 493 |
# configured for your Swift cluster. By default the three replicas would need a |
| 494 | 494 |
# bit of IO and Memory on a VM you may want to lower that to 1 if you want to do |
| 495 | 495 |
# only some quick testing. |
| ... | ... |
@@ -514,8 +530,8 @@ S3_SERVICE_PORT=${S3_SERVICE_PORT:-3333}
|
| 514 | 514 |
# Keystone |
| 515 | 515 |
# -------- |
| 516 | 516 |
|
| 517 |
-# Service Token - Openstack components need to have an admin token |
|
| 518 |
-# to validate user tokens. |
|
| 517 |
+# The ``SERVICE_TOKEN`` is used to bootstrap the Keystone database. It is |
|
| 518 |
+# just a string and is not a 'real' Keystone token. |
|
| 519 | 519 |
read_password SERVICE_TOKEN "ENTER A SERVICE_TOKEN TO USE FOR THE SERVICE ADMIN TOKEN." |
| 520 | 520 |
# Services authenticate to Identity with servicename/SERVICE_PASSWORD |
| 521 | 521 |
read_password SERVICE_PASSWORD "ENTER A SERVICE_PASSWORD TO USE FOR THE SERVICE AUTHENTICATION." |
| ... | ... |
@@ -547,10 +563,10 @@ APACHE_GROUP=${APACHE_GROUP:-$APACHE_USER}
|
| 547 | 547 |
# Log files |
| 548 | 548 |
# --------- |
| 549 | 549 |
|
| 550 |
-# Set up logging for stack.sh |
|
| 551 |
-# Set LOGFILE to turn on logging |
|
| 552 |
-# We append '.xxxxxxxx' to the given name to maintain history |
|
| 553 |
-# where xxxxxxxx is a representation of the date the file was created |
|
| 550 |
+# Set up logging for ``stack.sh`` |
|
| 551 |
+# Set ``LOGFILE`` to turn on logging |
|
| 552 |
+# Append '.xxxxxxxx' to the given name to maintain history |
|
| 553 |
+# where 'xxxxxxxx' is a representation of the date the file was created |
|
| 554 | 554 |
if [[ -n "$LOGFILE" || -n "$SCREEN_LOGDIR" ]]; then |
| 555 | 555 |
LOGDAYS=${LOGDAYS:-7}
|
| 556 | 556 |
TIMESTAMP_FORMAT=${TIMESTAMP_FORMAT:-"%F-%H%M%S"}
|
| ... | ... |
@@ -558,7 +574,7 @@ if [[ -n "$LOGFILE" || -n "$SCREEN_LOGDIR" ]]; then |
| 558 | 558 |
fi |
| 559 | 559 |
|
| 560 | 560 |
if [[ -n "$LOGFILE" ]]; then |
| 561 |
- # First clean up old log files. Use the user-specified LOGFILE |
|
| 561 |
+ # First clean up old log files. Use the user-specified ``LOGFILE`` |
|
| 562 | 562 |
# as the template to search for, appending '.*' to match the date |
| 563 | 563 |
# we added on earlier runs. |
| 564 | 564 |
LOGDIR=$(dirname "$LOGFILE") |
| ... | ... |
@@ -575,11 +591,11 @@ if [[ -n "$LOGFILE" ]]; then |
| 575 | 575 |
fi |
| 576 | 576 |
|
| 577 | 577 |
# Set up logging of screen windows |
| 578 |
-# Set SCREEN_LOGDIR to turn on logging of screen windows to the |
|
| 579 |
-# directory specified in SCREEN_LOGDIR, we will log to the the file |
|
| 580 |
-# screen-$SERVICE_NAME-$TIMESTAMP.log in that dir and have a link |
|
| 581 |
-# screen-$SERVICE_NAME.log to the latest log file. |
|
| 582 |
-# Logs are kept for as long specified in LOGDAYS. |
|
| 578 |
+# Set ``SCREEN_LOGDIR`` to turn on logging of screen windows to the |
|
| 579 |
+# directory specified in ``SCREEN_LOGDIR``, we will log to the the file |
|
| 580 |
+# ``screen-$SERVICE_NAME-$TIMESTAMP.log`` in that dir and have a link |
|
| 581 |
+# ``screen-$SERVICE_NAME.log`` to the latest log file. |
|
| 582 |
+# Logs are kept for as long specified in ``LOGDAYS``. |
|
| 583 | 583 |
if [[ -n "$SCREEN_LOGDIR" ]]; then |
| 584 | 584 |
|
| 585 | 585 |
# We make sure the directory is created. |
| ... | ... |
@@ -591,8 +607,11 @@ if [[ -n "$SCREEN_LOGDIR" ]]; then |
| 591 | 591 |
fi |
| 592 | 592 |
fi |
| 593 | 593 |
|
| 594 |
-# So that errors don't compound we exit on any errors so you see only the |
|
| 595 |
-# first error that occurred. |
|
| 594 |
+ |
|
| 595 |
+# Set Up Script Execution |
|
| 596 |
+# ----------------------- |
|
| 597 |
+ |
|
| 598 |
+# Exit on any errors so that errors don't compound |
|
| 596 | 599 |
trap failed ERR |
| 597 | 600 |
failed() {
|
| 598 | 601 |
local r=$? |
| ... | ... |
@@ -609,7 +628,7 @@ set -o xtrace |
| 609 | 609 |
# Install Packages |
| 610 | 610 |
# ================ |
| 611 | 611 |
|
| 612 |
-# Openstack uses a fair number of other projects. |
|
| 612 |
+# OpenStack uses a fair number of other projects. |
|
| 613 | 613 |
|
| 614 | 614 |
# Install package requirements |
| 615 | 615 |
if [[ "$os_PACKAGE" = "deb" ]]; then |
| ... | ... |
@@ -650,7 +669,7 @@ mysql-server-5.1 mysql-server/start_on_boot boolean true |
| 650 | 650 |
MYSQL_PRESEED |
| 651 | 651 |
fi |
| 652 | 652 |
|
| 653 |
- # while ``.my.cnf`` is not needed for openstack to function, it is useful |
|
| 653 |
+ # while ``.my.cnf`` is not needed for OpenStack to function, it is useful |
|
| 654 | 654 |
# as it allows you to access the mysql databases via ``mysql nova`` instead |
| 655 | 655 |
# of having to specify the username/password each time. |
| 656 | 656 |
if [[ ! -e $HOME/.my.cnf ]]; then |
| ... | ... |
@@ -702,8 +721,6 @@ fi |
| 702 | 702 |
|
| 703 | 703 |
if is_service_enabled n-cpu; then |
| 704 | 704 |
|
| 705 |
- # Virtualization Configuration |
|
| 706 |
- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 707 | 705 |
if [[ "$os_PACKAGE" = "deb" ]]; then |
| 708 | 706 |
LIBVIRT_PKG_NAME=libvirt-bin |
| 709 | 707 |
else |
| ... | ... |
@@ -746,7 +763,10 @@ fi |
| 746 | 746 |
# Install python requirements |
| 747 | 747 |
pip_install $(get_packages $FILES/pips | sort -u) |
| 748 | 748 |
|
| 749 |
-# Check out OpenStack sources |
|
| 749 |
+ |
|
| 750 |
+# Check Out Source |
|
| 751 |
+# ---------------- |
|
| 752 |
+ |
|
| 750 | 753 |
git_clone $NOVA_REPO $NOVA_DIR $NOVA_BRANCH |
| 751 | 754 |
|
| 752 | 755 |
# Check out the client libs that are used most |
| ... | ... |
@@ -799,6 +819,7 @@ if is_service_enabled ceilometer; then |
| 799 | 799 |
install_ceilometer |
| 800 | 800 |
fi |
| 801 | 801 |
|
| 802 |
+ |
|
| 802 | 803 |
# Initialization |
| 803 | 804 |
# ============== |
| 804 | 805 |
|
| ... | ... |
@@ -822,6 +843,7 @@ if is_service_enabled g-api n-api; then |
| 822 | 822 |
fi |
| 823 | 823 |
|
| 824 | 824 |
# Do this _after_ glance is installed to override the old binary |
| 825 |
+# TODO(dtroyer): figure out when this is no longer necessary |
|
| 825 | 826 |
setup_develop $GLANCECLIENT_DIR |
| 826 | 827 |
|
| 827 | 828 |
setup_develop $NOVA_DIR |
| ... | ... |
@@ -848,6 +870,7 @@ if [[ $TRACK_DEPENDS = True ]] ; then |
| 848 | 848 |
exit 0 |
| 849 | 849 |
fi |
| 850 | 850 |
|
| 851 |
+ |
|
| 851 | 852 |
# Syslog |
| 852 | 853 |
# ------ |
| 853 | 854 |
|
| ... | ... |
@@ -889,10 +912,9 @@ fi |
| 889 | 889 |
# Mysql |
| 890 | 890 |
# ----- |
| 891 | 891 |
|
| 892 |
- |
|
| 893 | 892 |
if is_service_enabled mysql; then |
| 894 | 893 |
|
| 895 |
- #start mysql-server |
|
| 894 |
+ # Start mysql-server |
|
| 896 | 895 |
if [[ "$os_PACKAGE" = "rpm" ]]; then |
| 897 | 896 |
# RPM doesn't start the service |
| 898 | 897 |
start_service mysqld |
| ... | ... |
@@ -1015,7 +1037,8 @@ if is_service_enabled horizon; then |
| 1015 | 1015 |
APACHE_CONF=conf.d/horizon.conf |
| 1016 | 1016 |
sudo sed '/^Listen/s/^.*$/Listen 0.0.0.0:80/' -i /etc/httpd/conf/httpd.conf |
| 1017 | 1017 |
fi |
| 1018 |
- ## Configure apache to run horizon |
|
| 1018 |
+ |
|
| 1019 |
+ # Configure apache to run horizon |
|
| 1019 | 1020 |
sudo sh -c "sed -e \" |
| 1020 | 1021 |
s,%USER%,$APACHE_USER,g; |
| 1021 | 1022 |
s,%GROUP%,$APACHE_GROUP,g; |
| ... | ... |
@@ -1023,6 +1046,7 @@ if is_service_enabled horizon; then |
| 1023 | 1023 |
s,%APACHE_NAME%,$APACHE_NAME,g; |
| 1024 | 1024 |
s,%DEST%,$DEST,g; |
| 1025 | 1025 |
\" $FILES/apache-horizon.template >/etc/$APACHE_NAME/$APACHE_CONF" |
| 1026 |
+ |
|
| 1026 | 1027 |
restart_service $APACHE_NAME |
| 1027 | 1028 |
fi |
| 1028 | 1029 |
|
| ... | ... |
@@ -1106,7 +1130,7 @@ fi |
| 1106 | 1106 |
# ------- |
| 1107 | 1107 |
|
| 1108 | 1108 |
if is_service_enabled quantum; then |
| 1109 |
- # Put config files in /etc/quantum for everyone to find |
|
| 1109 |
+ # Put config files in ``/etc/quantum`` for everyone to find |
|
| 1110 | 1110 |
if [[ ! -d /etc/quantum ]]; then |
| 1111 | 1111 |
sudo mkdir -p /etc/quantum |
| 1112 | 1112 |
fi |
| ... | ... |
@@ -1127,7 +1151,7 @@ if is_service_enabled quantum; then |
| 1127 | 1127 |
exit 1 |
| 1128 | 1128 |
fi |
| 1129 | 1129 |
|
| 1130 |
- # If needed, move config file from $QUANTUM_DIR/etc/quantum to /etc/quantum |
|
| 1130 |
+ # If needed, move config file from ``$QUANTUM_DIR/etc/quantum`` to ``/etc/quantum`` |
|
| 1131 | 1131 |
mkdir -p /$Q_PLUGIN_CONF_PATH |
| 1132 | 1132 |
Q_PLUGIN_CONF_FILE=$Q_PLUGIN_CONF_PATH/$Q_PLUGIN_CONF_FILENAME |
| 1133 | 1133 |
cp $QUANTUM_DIR/$Q_PLUGIN_CONF_FILE /$Q_PLUGIN_CONF_FILE |
| ... | ... |
@@ -1265,10 +1289,11 @@ screen_it q-agt "sudo python $AGENT_BINARY --config-file $Q_CONF_FILE --config-f |
| 1265 | 1265 |
# Start up the quantum agent |
| 1266 | 1266 |
screen_it q-dhcp "sudo python $AGENT_DHCP_BINARY --config-file $Q_CONF_FILE --config-file=$Q_DHCP_CONF_FILE" |
| 1267 | 1267 |
|
| 1268 |
+ |
|
| 1268 | 1269 |
# Nova |
| 1269 | 1270 |
# ---- |
| 1270 | 1271 |
|
| 1271 |
-# Put config files in /etc/nova for everyone to find |
|
| 1272 |
+# Put config files in ``/etc/nova`` for everyone to find |
|
| 1272 | 1273 |
NOVA_CONF_DIR=/etc/nova |
| 1273 | 1274 |
if [[ ! -d $NOVA_CONF_DIR ]]; then |
| 1274 | 1275 |
sudo mkdir -p $NOVA_CONF_DIR |
| ... | ... |
@@ -1278,7 +1303,7 @@ sudo chown `whoami` $NOVA_CONF_DIR |
| 1278 | 1278 |
cp -p $NOVA_DIR/etc/nova/policy.json $NOVA_CONF_DIR |
| 1279 | 1279 |
|
| 1280 | 1280 |
# If Nova ships the new rootwrap filters files, deploy them |
| 1281 |
-# (owned by root) and add a parameter to $NOVA_ROOTWRAP |
|
| 1281 |
+# (owned by root) and add a parameter to ``$NOVA_ROOTWRAP`` |
|
| 1282 | 1282 |
ROOTWRAP_SUDOER_CMD="$NOVA_ROOTWRAP" |
| 1283 | 1283 |
if [[ -d $NOVA_DIR/etc/nova/rootwrap.d ]]; then |
| 1284 | 1284 |
# Wipe any existing rootwrap.d files first |
| ... | ... |
@@ -1351,7 +1376,7 @@ if is_service_enabled n-cpu; then |
| 1351 | 1351 |
# Force IP forwarding on, just on case |
| 1352 | 1352 |
sudo sysctl -w net.ipv4.ip_forward=1 |
| 1353 | 1353 |
|
| 1354 |
- # attempt to load modules: network block device - used to manage qcow images |
|
| 1354 |
+ # Attempt to load modules: network block device - used to manage qcow images |
|
| 1355 | 1355 |
sudo modprobe nbd || true |
| 1356 | 1356 |
|
| 1357 | 1357 |
# Check for kvm (hardware based virtualization). If unable to initialize |
| ... | ... |
@@ -1415,9 +1440,11 @@ ResultActive=yes |
| 1415 | 1415 |
EOF' |
| 1416 | 1416 |
LIBVIRT_DAEMON=libvirtd |
| 1417 | 1417 |
fi |
| 1418 |
- # The user that nova runs as needs to be member of libvirtd group otherwise |
|
| 1418 |
+ |
|
| 1419 |
+ # The user that nova runs as needs to be member of **libvirtd** group otherwise |
|
| 1419 | 1420 |
# nova-compute will be unable to use libvirt. |
| 1420 | 1421 |
sudo usermod -a -G libvirtd `whoami` |
| 1422 |
+ |
|
| 1421 | 1423 |
# libvirt detects various settings on startup, as we potentially changed |
| 1422 | 1424 |
# the system configuration (modules, filesystems), we need to restart |
| 1423 | 1425 |
# libvirt to detect those changes. |
| ... | ... |
@@ -1475,17 +1502,17 @@ fi |
| 1475 | 1475 |
|
| 1476 | 1476 |
if is_service_enabled swift; then |
| 1477 | 1477 |
|
| 1478 |
- # We make sure to kill all swift processes first |
|
| 1478 |
+ # Make sure to kill all swift processes first |
|
| 1479 | 1479 |
swift-init all stop || true |
| 1480 | 1480 |
|
| 1481 |
- # We first do a bit of setup by creating the directories and |
|
| 1481 |
+ # First do a bit of setup by creating the directories and |
|
| 1482 | 1482 |
# changing the permissions so we can run it as our user. |
| 1483 | 1483 |
|
| 1484 | 1484 |
USER_GROUP=$(id -g) |
| 1485 | 1485 |
sudo mkdir -p ${SWIFT_DATA_DIR}/drives
|
| 1486 | 1486 |
sudo chown -R $USER:${USER_GROUP} ${SWIFT_DATA_DIR}
|
| 1487 | 1487 |
|
| 1488 |
- # We then create a loopback disk and format it to XFS. |
|
| 1488 |
+ # Create a loopback disk and format it to XFS. |
|
| 1489 | 1489 |
if [[ -e ${SWIFT_DATA_DIR}/drives/images/swift.img ]]; then
|
| 1490 | 1490 |
if egrep -q ${SWIFT_DATA_DIR}/drives/sdb1 /proc/mounts; then
|
| 1491 | 1491 |
sudo umount ${SWIFT_DATA_DIR}/drives/sdb1
|
| ... | ... |
@@ -1498,24 +1525,22 @@ if is_service_enabled swift; then |
| 1498 | 1498 |
dd if=/dev/zero of=${SWIFT_DATA_DIR}/drives/images/swift.img \
|
| 1499 | 1499 |
bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE}
|
| 1500 | 1500 |
fi |
| 1501 |
+ |
|
| 1501 | 1502 |
# Make a fresh XFS filesystem |
| 1502 | 1503 |
mkfs.xfs -f -i size=1024 ${SWIFT_DATA_DIR}/drives/images/swift.img
|
| 1503 | 1504 |
|
| 1504 |
- # After the drive being created we mount the disk with a few mount |
|
| 1505 |
- # options to make it most efficient as possible for swift. |
|
| 1505 |
+ # Mount the disk with mount options to make it as efficient as possible |
|
| 1506 | 1506 |
mkdir -p ${SWIFT_DATA_DIR}/drives/sdb1
|
| 1507 | 1507 |
if ! egrep -q ${SWIFT_DATA_DIR}/drives/sdb1 /proc/mounts; then
|
| 1508 | 1508 |
sudo mount -t xfs -o loop,noatime,nodiratime,nobarrier,logbufs=8 \ |
| 1509 | 1509 |
${SWIFT_DATA_DIR}/drives/images/swift.img ${SWIFT_DATA_DIR}/drives/sdb1
|
| 1510 | 1510 |
fi |
| 1511 | 1511 |
|
| 1512 |
- # We then create link to that mounted location so swift would know |
|
| 1513 |
- # where to go. |
|
| 1512 |
+ # Create a link to the above mount |
|
| 1514 | 1513 |
for x in $(seq ${SWIFT_REPLICAS}); do
|
| 1515 | 1514 |
sudo ln -sf ${SWIFT_DATA_DIR}/drives/sdb1/$x ${SWIFT_DATA_DIR}/$x; done
|
| 1516 | 1515 |
|
| 1517 |
- # We now have to emulate a few different servers into one we |
|
| 1518 |
- # create all the directories needed for swift |
|
| 1516 |
+ # Create all of the directories needed to emulate a few different servers |
|
| 1519 | 1517 |
for x in $(seq ${SWIFT_REPLICAS}); do
|
| 1520 | 1518 |
drive=${SWIFT_DATA_DIR}/drives/sdb1/${x}
|
| 1521 | 1519 |
node=${SWIFT_DATA_DIR}/${x}/node
|
| ... | ... |
@@ -1531,7 +1556,7 @@ if is_service_enabled swift; then |
| 1531 | 1531 |
sudo chown -R $USER: ${SWIFT_CONFIG_DIR} /var/run/swift
|
| 1532 | 1532 |
|
| 1533 | 1533 |
if [[ "$SWIFT_CONFIG_DIR" != "/etc/swift" ]]; then |
| 1534 |
- # Some swift tools are hard-coded to use /etc/swift and are apparenty not going to be fixed. |
|
| 1534 |
+ # Some swift tools are hard-coded to use ``/etc/swift`` and are apparenty not going to be fixed. |
|
| 1535 | 1535 |
# Create a symlink if the config dir is moved |
| 1536 | 1536 |
sudo ln -sf ${SWIFT_CONFIG_DIR} /etc/swift
|
| 1537 | 1537 |
fi |
| ... | ... |
@@ -1622,9 +1647,8 @@ EOF |
| 1622 | 1622 |
cp ${SWIFT_DIR}/etc/swift.conf-sample ${SWIFT_CONFIG_DIR}/swift.conf
|
| 1623 | 1623 |
iniset ${SWIFT_CONFIG_DIR}/swift.conf swift-hash swift_hash_path_suffix ${SWIFT_HASH}
|
| 1624 | 1624 |
|
| 1625 |
- # We need to generate a object/account/proxy configuration |
|
| 1626 |
- # emulating 4 nodes on different ports we have a little function |
|
| 1627 |
- # that help us doing that. |
|
| 1625 |
+ # This function generates an object/account/proxy configuration |
|
| 1626 |
+ # emulating 4 nodes on different ports |
|
| 1628 | 1627 |
function generate_swift_configuration() {
|
| 1629 | 1628 |
local server_type=$1 |
| 1630 | 1629 |
local bind_port=$2 |
| ... | ... |
@@ -1667,8 +1691,8 @@ EOF |
| 1667 | 1667 |
generate_swift_configuration container 6011 2 |
| 1668 | 1668 |
generate_swift_configuration account 6012 2 |
| 1669 | 1669 |
|
| 1670 |
- # We have some specific configuration for swift for rsyslog. See |
|
| 1671 |
- # the file /etc/rsyslog.d/10-swift.conf for more info. |
|
| 1670 |
+ # Specific configuration for swift for rsyslog. See |
|
| 1671 |
+ # ``/etc/rsyslog.d/10-swift.conf`` for more info. |
|
| 1672 | 1672 |
swift_log_dir=${SWIFT_DATA_DIR}/logs
|
| 1673 | 1673 |
rm -rf ${swift_log_dir}
|
| 1674 | 1674 |
mkdir -p ${swift_log_dir}/hourly
|
| ... | ... |
@@ -1709,7 +1733,7 @@ EOF |
| 1709 | 1709 |
|
| 1710 | 1710 |
} && popd >/dev/null |
| 1711 | 1711 |
|
| 1712 |
- # We then can start rsync. |
|
| 1712 |
+ # Start rsync |
|
| 1713 | 1713 |
if [[ "$os_PACKAGE" = "deb" ]]; then |
| 1714 | 1714 |
sudo /etc/init.d/rsync restart || : |
| 1715 | 1715 |
else |
| ... | ... |
@@ -1762,7 +1786,7 @@ elif is_service_enabled n-vol; then |
| 1762 | 1762 |
sudo tgtadm --op show --mode target | grep $VOLUME_NAME_PREFIX | grep Target | cut -f3 -d ' ' | sudo xargs -n1 tgt-admin --delete || true |
| 1763 | 1763 |
# Clean out existing volumes |
| 1764 | 1764 |
for lv in `sudo lvs --noheadings -o lv_name $VOLUME_GROUP`; do |
| 1765 |
- # VOLUME_NAME_PREFIX prefixes the LVs we want |
|
| 1765 |
+ # ``VOLUME_NAME_PREFIX`` prefixes the LVs we want |
|
| 1766 | 1766 |
if [[ "${lv#$VOLUME_NAME_PREFIX}" != "$lv" ]]; then
|
| 1767 | 1767 |
sudo lvremove -f $VOLUME_GROUP/$lv |
| 1768 | 1768 |
fi |
| ... | ... |
@@ -1798,10 +1822,10 @@ function add_nova_opt {
|
| 1798 | 1798 |
echo "$1" >> $NOVA_CONF_DIR/$NOVA_CONF |
| 1799 | 1799 |
} |
| 1800 | 1800 |
|
| 1801 |
-# Remove legacy nova.conf |
|
| 1801 |
+# Remove legacy ``nova.conf`` |
|
| 1802 | 1802 |
rm -f $NOVA_DIR/bin/nova.conf |
| 1803 | 1803 |
|
| 1804 |
-# (re)create nova.conf |
|
| 1804 |
+# (Re)create ``nova.conf`` |
|
| 1805 | 1805 |
rm -f $NOVA_CONF_DIR/$NOVA_CONF |
| 1806 | 1806 |
add_nova_opt "[DEFAULT]" |
| 1807 | 1807 |
add_nova_opt "verbose=True" |
| ... | ... |
@@ -1911,13 +1935,13 @@ if is_service_enabled cinder; then |
| 1911 | 1911 |
add_nova_opt "volume_api_class=nova.volume.cinder.API" |
| 1912 | 1912 |
fi |
| 1913 | 1913 |
|
| 1914 |
-# Provide some transition from EXTRA_FLAGS to EXTRA_OPTS |
|
| 1914 |
+# Provide some transition from ``EXTRA_FLAGS`` to ``EXTRA_OPTS`` |
|
| 1915 | 1915 |
if [[ -z "$EXTRA_OPTS" && -n "$EXTRA_FLAGS" ]]; then |
| 1916 | 1916 |
EXTRA_OPTS=$EXTRA_FLAGS |
| 1917 | 1917 |
fi |
| 1918 | 1918 |
|
| 1919 |
-# You can define extra nova conf flags by defining the array EXTRA_OPTS, |
|
| 1920 |
-# For Example: EXTRA_OPTS=(foo=true bar=2) |
|
| 1919 |
+# Define extra nova conf flags by defining the array ``EXTRA_OPTS``. |
|
| 1920 |
+# For Example: ``EXTRA_OPTS=(foo=true bar=2)`` |
|
| 1921 | 1921 |
for I in "${EXTRA_OPTS[@]}"; do
|
| 1922 | 1922 |
# Attempt to convert flags to options |
| 1923 | 1923 |
add_nova_opt ${I//--}
|
| ... | ... |
@@ -1954,42 +1978,46 @@ fi |
| 1954 | 1954 |
|
| 1955 | 1955 |
|
| 1956 | 1956 |
# Nova Database |
| 1957 |
-# ~~~~~~~~~~~~~ |
|
| 1957 |
+# ------------- |
|
| 1958 | 1958 |
|
| 1959 | 1959 |
# All nova components talk to a central database. We will need to do this step |
| 1960 | 1960 |
# only once for an entire cluster. |
| 1961 | 1961 |
|
| 1962 | 1962 |
if is_service_enabled mysql && is_service_enabled nova; then |
| 1963 |
- # (re)create nova database |
|
| 1963 |
+ # (Re)create nova database |
|
| 1964 | 1964 |
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS nova;' |
| 1965 |
+ |
|
| 1965 | 1966 |
# Explicitly use latin1: to avoid lp#829209, nova expects the database to |
| 1966 | 1967 |
# use latin1 by default, and then upgrades the database to utf8 (see the |
| 1967 | 1968 |
# 082_essex.py in nova) |
| 1968 | 1969 |
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'CREATE DATABASE nova CHARACTER SET latin1;' |
| 1969 | 1970 |
|
| 1970 |
- # (re)create nova database |
|
| 1971 |
+ # (Re)create nova database |
|
| 1971 | 1972 |
$NOVA_BIN_DIR/nova-manage db sync |
| 1972 | 1973 |
fi |
| 1973 | 1974 |
|
| 1975 |
+ |
|
| 1974 | 1976 |
# Heat |
| 1975 |
-# ------ |
|
| 1977 |
+# ---- |
|
| 1978 |
+ |
|
| 1976 | 1979 |
if is_service_enabled heat; then |
| 1977 | 1980 |
init_heat |
| 1978 | 1981 |
fi |
| 1979 | 1982 |
|
| 1983 |
+ |
|
| 1980 | 1984 |
# Launch Services |
| 1981 | 1985 |
# =============== |
| 1982 | 1986 |
|
| 1983 |
-# nova api crashes if we start it with a regular screen command, |
|
| 1987 |
+# Nova api crashes if we start it with a regular screen command, |
|
| 1984 | 1988 |
# so send the start command by forcing text into the window. |
| 1985 | 1989 |
# Only run the services specified in ``ENABLED_SERVICES`` |
| 1986 | 1990 |
|
| 1987 |
-# launch the glance registry service |
|
| 1991 |
+# Launch the glance registry service |
|
| 1988 | 1992 |
if is_service_enabled g-reg; then |
| 1989 | 1993 |
screen_it g-reg "cd $GLANCE_DIR; bin/glance-registry --config-file=$GLANCE_CONF_DIR/glance-registry.conf" |
| 1990 | 1994 |
fi |
| 1991 | 1995 |
|
| 1992 |
-# launch the glance api and wait for it to answer before continuing |
|
| 1996 |
+# Launch the glance api and wait for it to answer before continuing |
|
| 1993 | 1997 |
if is_service_enabled g-api; then |
| 1994 | 1998 |
screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=$GLANCE_CONF_DIR/glance-api.conf" |
| 1995 | 1999 |
echo "Waiting for g-api ($GLANCE_HOSTPORT) to start..." |
| ... | ... |
@@ -2000,7 +2028,7 @@ if is_service_enabled g-api; then |
| 2000 | 2000 |
fi |
| 2001 | 2001 |
|
| 2002 | 2002 |
if is_service_enabled key; then |
| 2003 |
- # (re)create keystone database |
|
| 2003 |
+ # (Re)create keystone database |
|
| 2004 | 2004 |
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS keystone;' |
| 2005 | 2005 |
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'CREATE DATABASE keystone CHARACTER SET utf8;' |
| 2006 | 2006 |
|
| ... | ... |
@@ -2018,7 +2046,7 @@ if is_service_enabled key; then |
| 2018 | 2018 |
cp -p $KEYSTONE_DIR/etc/policy.json $KEYSTONE_CONF_DIR |
| 2019 | 2019 |
fi |
| 2020 | 2020 |
|
| 2021 |
- # Rewrite stock keystone.conf: |
|
| 2021 |
+ # Rewrite stock ``keystone.conf`` |
|
| 2022 | 2022 |
iniset $KEYSTONE_CONF DEFAULT admin_token "$SERVICE_TOKEN" |
| 2023 | 2023 |
iniset $KEYSTONE_CONF sql connection "$BASE_SQL_CONN/keystone?charset=utf8" |
| 2024 | 2024 |
iniset $KEYSTONE_CONF ec2 driver "keystone.contrib.ec2.backends.sql.Ec2" |
| ... | ... |
@@ -2029,12 +2057,13 @@ if is_service_enabled key; then |
| 2029 | 2029 |
iniset $KEYSTONE_CONF filter:s3_extension paste.filter_factory "keystone.contrib.s3:S3Extension.factory" |
| 2030 | 2030 |
|
| 2031 | 2031 |
if [[ "$KEYSTONE_CATALOG_BACKEND" = "sql" ]]; then |
| 2032 |
- # Configure keystone.conf to use sql |
|
| 2032 |
+ # Configure ``keystone.conf`` to use sql |
|
| 2033 | 2033 |
iniset $KEYSTONE_CONF catalog driver keystone.catalog.backends.sql.Catalog |
| 2034 | 2034 |
inicomment $KEYSTONE_CONF catalog template_file |
| 2035 | 2035 |
else |
| 2036 | 2036 |
KEYSTONE_CATALOG=$KEYSTONE_CONF_DIR/default_catalog.templates |
| 2037 | 2037 |
cp -p $FILES/default_catalog.templates $KEYSTONE_CATALOG |
| 2038 |
+ |
|
| 2038 | 2039 |
# Add swift endpoints to service catalog if swift is enabled |
| 2039 | 2040 |
if is_service_enabled swift; then |
| 2040 | 2041 |
echo "catalog.RegionOne.object_store.publicURL = http://%SERVICE_HOST%:8080/v1/AUTH_\$(tenant_id)s" >> $KEYSTONE_CATALOG |
| ... | ... |
@@ -2056,7 +2085,7 @@ if is_service_enabled key; then |
| 2056 | 2056 |
s,%S3_SERVICE_PORT%,$S3_SERVICE_PORT,g; |
| 2057 | 2057 |
" -i $KEYSTONE_CATALOG |
| 2058 | 2058 |
|
| 2059 |
- # Configure keystone.conf to use templates |
|
| 2059 |
+ # Configure ``keystone.conf`` to use templates |
|
| 2060 | 2060 |
iniset $KEYSTONE_CONF catalog driver "keystone.catalog.backends.templated.TemplatedCatalog" |
| 2061 | 2061 |
iniset $KEYSTONE_CONF catalog template_file "$KEYSTONE_CATALOG" |
| 2062 | 2062 |
fi |
| ... | ... |
@@ -2073,10 +2102,11 @@ if is_service_enabled key; then |
| 2073 | 2073 |
|
| 2074 | 2074 |
# Initialize keystone database |
| 2075 | 2075 |
$KEYSTONE_DIR/bin/keystone-manage db_sync |
| 2076 |
- # set up certificates |
|
| 2076 |
+ |
|
| 2077 |
+ # Set up certificates |
|
| 2077 | 2078 |
$KEYSTONE_DIR/bin/keystone-manage pki_setup |
| 2078 | 2079 |
|
| 2079 |
- # launch keystone and wait for it to answer before continuing |
|
| 2080 |
+ # Launch keystone and wait for it to answer before continuing |
|
| 2080 | 2081 |
screen_it key "cd $KEYSTONE_DIR && $KEYSTONE_DIR/bin/keystone-all --config-file $KEYSTONE_CONF $KEYSTONE_LOG_CONFIG -d --debug" |
| 2081 | 2082 |
echo "Waiting for keystone to start..." |
| 2082 | 2083 |
if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= curl -s $KEYSTONE_AUTH_PROTOCOL://$SERVICE_HOST:$KEYSTONE_API_PORT/v2.0/ >/dev/null; do sleep 1; done"; then |
| ... | ... |
@@ -2084,7 +2114,7 @@ if is_service_enabled key; then |
| 2084 | 2084 |
exit 1 |
| 2085 | 2085 |
fi |
| 2086 | 2086 |
|
| 2087 |
- # keystone_data.sh creates services, admin and demo users, and roles. |
|
| 2087 |
+ # ``keystone_data.sh`` creates services, admin and demo users, and roles. |
|
| 2088 | 2088 |
SERVICE_ENDPOINT=$KEYSTONE_AUTH_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT/v2.0 |
| 2089 | 2089 |
|
| 2090 | 2090 |
ADMIN_PASSWORD=$ADMIN_PASSWORD SERVICE_TENANT_NAME=$SERVICE_TENANT_NAME SERVICE_PASSWORD=$SERVICE_PASSWORD \ |
| ... | ... |
@@ -2130,7 +2160,7 @@ if is_service_enabled q-svc; then |
| 2130 | 2130 |
|
| 2131 | 2131 |
# Create a small network |
| 2132 | 2132 |
# Since quantum command is executed in admin context at this point, |
| 2133 |
- # --tenant_id needs to be specified. |
|
| 2133 |
+ # ``--tenant_id`` needs to be specified. |
|
| 2134 | 2134 |
NET_ID=$(quantum net-create --tenant_id $TENANT_ID net1 | grep ' id ' | get_field 2) |
| 2135 | 2135 |
quantum subnet-create --tenant_id $TENANT_ID --ip_version 4 --gateway $NETWORK_GATEWAY $NET_ID $FIXED_RANGE |
| 2136 | 2136 |
elif is_service_enabled mysql && is_service_enabled nova; then |
| ... | ... |
@@ -2144,12 +2174,9 @@ elif is_service_enabled mysql && is_service_enabled nova; then |
| 2144 | 2144 |
$NOVA_BIN_DIR/nova-manage floating create --ip_range=$TEST_FLOATING_RANGE --pool=$TEST_FLOATING_POOL |
| 2145 | 2145 |
fi |
| 2146 | 2146 |
|
| 2147 |
-# Launching nova-compute should be as simple as running ``nova-compute`` but |
|
| 2148 |
-# have to do a little more than that in our script. Since we add the group |
|
| 2149 |
-# ``libvirtd`` to our user in this script, when nova-compute is run it is |
|
| 2150 |
-# within the context of our original shell (so our groups won't be updated). |
|
| 2151 |
-# Use 'sg' to execute nova-compute as a member of the libvirtd group. |
|
| 2152 |
-# We don't check for is_service_enable as screen_it does it for us |
|
| 2147 |
+# The group **libvirtd** is added to the current user in this script. |
|
| 2148 |
+# Use 'sg' to execute nova-compute as a member of the **libvirtd** group. |
|
| 2149 |
+# ``screen_it`` checks ``is_service_enabled``, it is not needed here |
|
| 2153 | 2150 |
screen_it n-cpu "cd $NOVA_DIR && sg libvirtd $NOVA_BIN_DIR/nova-compute" |
| 2154 | 2151 |
screen_it n-crt "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-cert" |
| 2155 | 2152 |
screen_it n-vol "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-volume" |
| ... | ... |
@@ -2178,18 +2205,17 @@ if is_service_enabled heat; then |
| 2178 | 2178 |
start_heat |
| 2179 | 2179 |
fi |
| 2180 | 2180 |
|
| 2181 |
+ |
|
| 2181 | 2182 |
# Install Images |
| 2182 | 2183 |
# ============== |
| 2183 | 2184 |
|
| 2184 | 2185 |
# Upload an image to glance. |
| 2185 | 2186 |
# |
| 2186 |
-# The default image is cirros, a small testing image, which lets you login as root |
|
| 2187 |
-# |
|
| 2187 |
+# The default image is cirros, a small testing image which lets you login as **root** |
|
| 2188 | 2188 |
# cirros also uses ``cloud-init``, supporting login via keypair and sending scripts as |
| 2189 | 2189 |
# userdata. See https://help.ubuntu.com/community/CloudInit for more on cloud-init |
| 2190 | 2190 |
# |
| 2191 |
-# Override ``IMAGE_URLS`` with a comma-separated list of uec images. |
|
| 2192 |
-# |
|
| 2191 |
+# Override ``IMAGE_URLS`` with a comma-separated list of UEC images. |
|
| 2193 | 2192 |
# * **oneiric**: http://uec-images.ubuntu.com/oneiric/current/oneiric-server-cloudimg-amd64.tar.gz |
| 2194 | 2193 |
# * **precise**: http://uec-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64.tar.gz |
| 2195 | 2194 |
|
| ... | ... |
@@ -2224,7 +2250,7 @@ set +o xtrace |
| 2224 | 2224 |
|
| 2225 | 2225 |
|
| 2226 | 2226 |
# Using the cloud |
| 2227 |
-# =============== |
|
| 2227 |
+# --------------- |
|
| 2228 | 2228 |
|
| 2229 | 2229 |
echo "" |
| 2230 | 2230 |
echo "" |
| ... | ... |
@@ -2244,7 +2270,7 @@ if is_service_enabled key; then |
| 2244 | 2244 |
echo "The password: $ADMIN_PASSWORD" |
| 2245 | 2245 |
fi |
| 2246 | 2246 |
|
| 2247 |
-# Echo HOST_IP - useful for build_uec.sh, which uses dhcp to give the instance an address |
|
| 2247 |
+# Echo ``HOST_IP`` - useful for ``build_uec.sh``, which uses dhcp to give the instance an address |
|
| 2248 | 2248 |
echo "This is your host ip: $HOST_IP" |
| 2249 | 2249 |
|
| 2250 | 2250 |
# Warn that ``EXTRA_FLAGS`` needs to be converted to ``EXTRA_OPTS`` |
| ... | ... |
@@ -2252,5 +2278,5 @@ if [[ -n "$EXTRA_FLAGS" ]]; then |
| 2252 | 2252 |
echo "WARNING: EXTRA_FLAGS is defined and may need to be converted to EXTRA_OPTS" |
| 2253 | 2253 |
fi |
| 2254 | 2254 |
|
| 2255 |
-# Indicate how long this took to run (bash maintained variable 'SECONDS') |
|
| 2255 |
+# Indicate how long this took to run (bash maintained variable ``SECONDS``) |
|
| 2256 | 2256 |
echo "stack.sh completed in $SECONDS seconds." |
| ... | ... |
@@ -1,3 +1,5 @@ |
| 1 |
+# stackrc |
|
| 2 |
+# |
|
| 1 | 3 |
# Find the other rc files |
| 2 | 4 |
RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd) |
| 3 | 5 |
|
| ... | ... |
@@ -5,21 +7,22 @@ RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd) |
| 5 | 5 |
DEST=/opt/stack |
| 6 | 6 |
|
| 7 | 7 |
# Specify which services to launch. These generally correspond to |
| 8 |
-# screen tabs. If you like to add other services that are not enabled |
|
| 9 |
-# by default you can append them in your ENABLED_SERVICES variable in |
|
| 10 |
-# your localrc. For example for swift you can just add this in your |
|
| 11 |
-# localrc to add it with the other services: |
|
| 12 |
-# ENABLED_SERVICES+=,swift |
|
| 8 |
+# screen tabs. To change the default list, use the ``enable_service`` and |
|
| 9 |
+# ``disable_service`` functions in ``localrc``. |
|
| 10 |
+# For example, to enable Swift add this to ``localrc``: |
|
| 11 |
+# enable_service swift |
|
| 13 | 12 |
# |
| 14 |
-# If you like to explicitly remove services you can add a -$service in |
|
| 15 |
-# ENABLED_SERVICES, for example in your localrc to install all defaults but not |
|
| 16 |
-# cinder you would just need to set this : |
|
| 17 |
-# ENABLED_SERVICES+=,-cinder |
|
| 13 |
+# And to disable Cinder and use Nova Volumes instead: |
|
| 14 |
+# disable_service c-api c-sch c-vol cinder |
|
| 15 |
+# enable_service n-vol |
|
| 18 | 16 |
ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,mysql,rabbit |
| 19 | 17 |
|
| 20 | 18 |
# Set the default Nova APIs to enable |
| 21 | 19 |
NOVA_ENABLED_APIS=ec2,osapi_compute,osapi_volume,metadata |
| 22 | 20 |
|
| 21 |
+# Repositories |
|
| 22 |
+# ------------ |
|
| 23 |
+ |
|
| 23 | 24 |
# Base GIT Repo URL |
| 24 | 25 |
# Another option is http://review.openstack.org/p |
| 25 | 26 |
GIT_BASE=https://github.com |
| ... | ... |
@@ -46,7 +49,6 @@ SWIFT_BRANCH=master |
| 46 | 46 |
SWIFT3_REPO=https://github.com/fujita/swift3.git |
| 47 | 47 |
SWIFT3_BRANCH=master |
| 48 | 48 |
|
| 49 |
- |
|
| 50 | 49 |
# python swift client library |
| 51 | 50 |
SWIFTCLIENT_REPO=${GIT_BASE}/openstack/python-swiftclient
|
| 52 | 51 |
SWIFTCLIENT_BRANCH=master |
| ... | ... |
@@ -75,7 +77,7 @@ HORIZON_BRANCH=master |
| 75 | 75 |
NOVACLIENT_REPO=${GIT_BASE}/openstack/python-novaclient.git
|
| 76 | 76 |
NOVACLIENT_BRANCH=master |
| 77 | 77 |
|
| 78 |
-# Shared openstack python client library |
|
| 78 |
+# consolidated openstack python client |
|
| 79 | 79 |
OPENSTACKCLIENT_REPO=${GIT_BASE}/openstack/python-openstackclient.git
|
| 80 | 80 |
OPENSTACKCLIENT_BRANCH=master |
| 81 | 81 |
|
| ... | ... |
@@ -110,7 +112,7 @@ if [ -f $RC_DIR/localrc ]; then |
| 110 | 110 |
source $RC_DIR/localrc |
| 111 | 111 |
fi |
| 112 | 112 |
|
| 113 |
-# Specify a comma-separated list of uec images to download and install into glance. |
|
| 113 |
+# Specify a comma-separated list of UEC images to download and install into glance. |
|
| 114 | 114 |
# supported urls here are: |
| 115 | 115 |
# * "uec-style" images: |
| 116 | 116 |
# If the file ends in .tar.gz, uncompress the tarball and and select the first |
| ... | ... |
@@ -123,13 +125,17 @@ fi |
| 123 | 123 |
# example: |
| 124 | 124 |
# http://cloud-images.ubuntu.com/releases/oneiric/release/ubuntu-11.10-server-cloudimg-armel-disk1.img |
| 125 | 125 |
# http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-rootfs.img.gz |
| 126 |
+# * OpenVZ image: |
|
| 127 |
+# OpenVZ uses its own format of image, and does not support UEC style images |
|
| 128 |
+ |
|
| 126 | 129 |
#IMAGE_URLS="http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-11.2_2.6.35-15_1.tar.gz" # old ttylinux-uec image |
| 127 | 130 |
#IMAGE_URLS="http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img" # cirros full disk image |
| 128 |
-# |
|
| 129 |
-# Set default image based on LIBVIRT_TYPE or VIRT_DRIVER, which may be set in localrc |
|
| 130 |
-# but allow DEFAULT_IMAGE_NAME and IMAGE_URLS to be set directly in localrc, too. |
|
| 131 |
+ |
|
| 132 |
+# Set default image based on ``VIRT_DRIVER`` and ``LIBVIRT_TYPE``, either of |
|
| 133 |
+# which may be set in ``localrc``. Also allow ``DEFAULT_IMAGE_NAME`` and |
|
| 134 |
+# ``IMAGE_URLS`` to be set directly in ``localrc``. |
|
| 131 | 135 |
case "$VIRT_DRIVER" in |
| 132 |
- openvz) # OpenVZ uses its own format of image, and does not support uec style images |
|
| 136 |
+ openvz) |
|
| 133 | 137 |
DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-ubuntu-11.10-x86_64}
|
| 134 | 138 |
IMAGE_URLS=${IMAGE_URLS:-"http://download.openvz.org/template/precreated/ubuntu-11.10-x86_64.tar.gz"};;
|
| 135 | 139 |
libvirt) |
| ... | ... |
@@ -6,7 +6,7 @@ |
| 6 | 6 |
# mysql and rabbit are left running as OpenStack code refreshes |
| 7 | 7 |
# do not require them to be restarted. |
| 8 | 8 |
# |
| 9 |
-# Stop all processes by setting UNSTACK_ALL or specifying ``--all`` |
|
| 9 |
+# Stop all processes by setting ``UNSTACK_ALL`` or specifying ``--all`` |
|
| 10 | 10 |
# on the command line |
| 11 | 11 |
|
| 12 | 12 |
# Keep track of the current devstack directory. |