Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update samples

* Skip commands for services that are not started in local.sh
* Rename localrc to local.conf

Change-Id: Ida3a8cc836d56db94da4a133fbeb81c7f5fc5f26
  • Loading branch information...
commit 38e38fb16d5d597e41c486812ae7ba480696b31c 1 parent bd49958
Dean Troyer dtroyer authored
Showing with 39 additions and 34 deletions.
  1. +8 −5 samples/{localrc → local.conf}
  2. +31 −29 samples/local.sh
13 samples/localrc → samples/local.conf
View
@@ -1,19 +1,22 @@
-# Sample ``localrc`` for user-configurable variables in ``stack.sh``
+# Sample ``local.conf`` for user-configurable variables in ``stack.sh``
# NOTE: Copy this file to the root ``devstack`` directory for it to
# work properly.
-# ``localrc`` is a user-maintained setings file that is sourced from ``stackrc``.
+# ``local.conf`` is a user-maintained setings file that is sourced from ``stackrc``.
# This gives it the ability to override any variables set in ``stackrc``.
# Also, most of the settings in ``stack.sh`` are written to only be set if no
-# value has already been set; this lets ``localrc`` effectively override the
+# value has already been set; this lets ``local.conf`` effectively override the
# default values.
# This is a collection of some of the settings we have found to be useful
# in our DevStack development environments. Additional settings are described
-# in http://devstack.org/localrc.html
+# in http://devstack.org/local.conf.html
# These should be considered as samples and are unsupported DevStack code.
+# The ``localrc`` section replaces the old ``localrc`` configuration file.
+# Note that if ``localrc`` is present it will be used in favor of this section.
+[[local|localrc]]
# Minimal Contents
# ----------------
@@ -22,7 +25,7 @@
# there are a few minimal variables set:
# If the ``*_PASSWORD`` variables are not set here you will be prompted to enter
-# values for them by ``stack.sh`` and they will be added to ``localrc``.
+# values for them by ``stack.sh`` and they will be added to ``local.conf``.
ADMIN_PASSWORD=nomoresecrete
MYSQL_PASSWORD=stackdb
RABBIT_PASSWORD=stackqueue
60 samples/local.sh
View
@@ -23,45 +23,47 @@ source $TOP_DIR/stackrc
# Destination path for installation ``DEST``
DEST=${DEST:-/opt/stack}
+if is_service_enabled nova; then
-# Import ssh keys
-# ---------------
+ # Import ssh keys
+ # ---------------
-# Import keys from the current user into the default OpenStack user (usually
-# ``demo``)
+ # Import keys from the current user into the default OpenStack user (usually
+ # ``demo``)
-# Get OpenStack auth
-source $TOP_DIR/openrc
+ # Get OpenStack user auth
+ source $TOP_DIR/openrc
-# Add first keypair found in localhost:$HOME/.ssh
-for i in $HOME/.ssh/id_rsa.pub $HOME/.ssh/id_dsa.pub; do
- if [[ -r $i ]]; then
- nova keypair-add --pub_key=$i `hostname`
- break
- fi
-done
+ # Add first keypair found in localhost:$HOME/.ssh
+ for i in $HOME/.ssh/id_rsa.pub $HOME/.ssh/id_dsa.pub; do
+ if [[ -r $i ]]; then
+ nova keypair-add --pub_key=$i `hostname`
+ break
+ fi
+ done
-# Create A Flavor
-# ---------------
+ # Create A Flavor
+ # ---------------
-# Get OpenStack admin auth
-source $TOP_DIR/openrc admin admin
+ # Get OpenStack admin auth
+ source $TOP_DIR/openrc admin admin
-# Name of new flavor
-# set in ``localrc`` with ``DEFAULT_INSTANCE_TYPE=m1.micro``
-MI_NAME=m1.micro
+ # Name of new flavor
+ # set in ``localrc`` with ``DEFAULT_INSTANCE_TYPE=m1.micro``
+ MI_NAME=m1.micro
-# Create micro flavor if not present
-if [[ -z $(nova flavor-list | grep $MI_NAME) ]]; then
- nova flavor-create $MI_NAME 6 128 0 1
-fi
+ # Create micro flavor if not present
+ if [[ -z $(nova flavor-list | grep $MI_NAME) ]]; then
+ nova flavor-create $MI_NAME 6 128 0 1
+ fi
-# Other Uses
-# ----------
+ # Other Uses
+ # ----------
-# Add tcp/22 and icmp to default security group
-nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
-nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
+ # Add tcp/22 and icmp to default security group
+ nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
+ nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
+fi
Please sign in to comment.
Something went wrong with that request. Please try again.