Browse code

Update samples

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

Change-Id: Ida3a8cc836d56db94da4a133fbeb81c7f5fc5f26

Dean Troyer authored on 2014/01/11 03:05:51
Showing 3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,93 @@
0
+# Sample ``local.conf`` for user-configurable variables in ``stack.sh``
1
+
2
+# NOTE: Copy this file to the root ``devstack`` directory for it to
3
+# work properly.
4
+
5
+# ``local.conf`` is a user-maintained setings file that is sourced from ``stackrc``.
6
+# This gives it the ability to override any variables set in ``stackrc``.
7
+# Also, most of the settings in ``stack.sh`` are written to only be set if no
8
+# value has already been set; this lets ``local.conf`` effectively override the
9
+# default values.
10
+
11
+# This is a collection of some of the settings we have found to be useful
12
+# in our DevStack development environments. Additional settings are described
13
+# in http://devstack.org/local.conf.html
14
+# These should be considered as samples and are unsupported DevStack code.
15
+
16
+# The ``localrc`` section replaces the old ``localrc`` configuration file.
17
+# Note that if ``localrc`` is present it will be used in favor of this section.
18
+[[local|localrc]]
19
+
20
+# Minimal Contents
21
+# ----------------
22
+
23
+# While ``stack.sh`` is happy to run without ``localrc``, devlife is better when
24
+# there are a few minimal variables set:
25
+
26
+# If the ``*_PASSWORD`` variables are not set here you will be prompted to enter
27
+# values for them by ``stack.sh`` and they will be added to ``local.conf``.
28
+ADMIN_PASSWORD=nomoresecrete
29
+MYSQL_PASSWORD=stackdb
30
+RABBIT_PASSWORD=stackqueue
31
+SERVICE_PASSWORD=$ADMIN_PASSWORD
32
+
33
+# ``HOST_IP`` should be set manually for best results if the NIC configuration
34
+# of the host is unusual, i.e. ``eth1`` has the default route but ``eth0`` is the
35
+# public interface.  It is auto-detected in ``stack.sh`` but often is indeterminate
36
+# on later runs due to the IP moving from an Ethernet interface to a bridge on
37
+# the host. Setting it here also makes it available for ``openrc`` to include
38
+# when setting ``OS_AUTH_URL``.
39
+# ``HOST_IP`` is not set by default.
40
+#HOST_IP=w.x.y.z
41
+
42
+
43
+# Logging
44
+# -------
45
+
46
+# By default ``stack.sh`` output only goes to the terminal where it runs.  It can
47
+# be configured to additionally log to a file by setting ``LOGFILE`` to the full
48
+# path of the destination log file.  A timestamp will be appended to the given name.
49
+LOGFILE=$DEST/logs/stack.sh.log
50
+
51
+# Old log files are automatically removed after 7 days to keep things neat.  Change
52
+# the number of days by setting ``LOGDAYS``.
53
+LOGDAYS=2
54
+
55
+# Nova logs will be colorized if ``SYSLOG`` is not set; turn this off by setting
56
+# ``LOG_COLOR`` false.
57
+#LOG_COLOR=False
58
+
59
+
60
+# Using milestone-proposed branches
61
+# ---------------------------------
62
+
63
+# Uncomment these to grab the milestone-proposed branches from the repos:
64
+#CINDER_BRANCH=milestone-proposed
65
+#GLANCE_BRANCH=milestone-proposed
66
+#HORIZON_BRANCH=milestone-proposed
67
+#KEYSTONE_BRANCH=milestone-proposed
68
+#KEYSTONECLIENT_BRANCH=milestone-proposed
69
+#NOVA_BRANCH=milestone-proposed
70
+#NOVACLIENT_BRANCH=milestone-proposed
71
+#NEUTRON_BRANCH=milestone-proposed
72
+#SWIFT_BRANCH=milestone-proposed
73
+
74
+
75
+# Swift
76
+# -----
77
+
78
+# Swift is now used as the back-end for the S3-like object store. If Nova's
79
+# objectstore (``n-obj`` in ``ENABLED_SERVICES``) is enabled, it will NOT
80
+# run if Swift is enabled. Setting the hash value is required and you will
81
+# be prompted for it if Swift is enabled so just set it to something already:
82
+SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
83
+
84
+# For development purposes the default of 3 replicas is usually not required.
85
+# Set this to 1 to save some resources:
86
+SWIFT_REPLICAS=1
87
+
88
+# The data for Swift is stored by default in (``$DEST/data/swift``),
89
+# or (``$DATA_DIR/swift``) if ``DATA_DIR`` has been set, and can be
90
+# moved by setting ``SWIFT_DATA_DIR``. The directory will be created
91
+# if it does not exist.
92
+SWIFT_DATA_DIR=$DEST/data
... ...
@@ -23,45 +23,47 @@ source $TOP_DIR/stackrc
23 23
 # Destination path for installation ``DEST``
24 24
 DEST=${DEST:-/opt/stack}
25 25
 
26
+if is_service_enabled nova; then
26 27
 
27
-# Import ssh keys
28
-# ---------------
28
+    # Import ssh keys
29
+    # ---------------
29 30
 
30
-# Import keys from the current user into the default OpenStack user (usually
31
-# ``demo``)
31
+    # Import keys from the current user into the default OpenStack user (usually
32
+    # ``demo``)
32 33
 
33
-# Get OpenStack auth
34
-source $TOP_DIR/openrc
34
+    # Get OpenStack user auth
35
+    source $TOP_DIR/openrc
35 36
 
36
-# Add first keypair found in localhost:$HOME/.ssh
37
-for i in $HOME/.ssh/id_rsa.pub $HOME/.ssh/id_dsa.pub; do
38
-    if [[ -r $i ]]; then
39
-        nova keypair-add --pub_key=$i `hostname`
40
-        break
41
-    fi
42
-done
37
+    # Add first keypair found in localhost:$HOME/.ssh
38
+    for i in $HOME/.ssh/id_rsa.pub $HOME/.ssh/id_dsa.pub; do
39
+        if [[ -r $i ]]; then
40
+            nova keypair-add --pub_key=$i `hostname`
41
+            break
42
+        fi
43
+    done
43 44
 
44 45
 
45
-# Create A Flavor
46
-# ---------------
46
+    # Create A Flavor
47
+    # ---------------
47 48
 
48
-# Get OpenStack admin auth
49
-source $TOP_DIR/openrc admin admin
49
+    # Get OpenStack admin auth
50
+    source $TOP_DIR/openrc admin admin
50 51
 
51
-# Name of new flavor
52
-# set in ``localrc`` with ``DEFAULT_INSTANCE_TYPE=m1.micro``
53
-MI_NAME=m1.micro
52
+    # Name of new flavor
53
+    # set in ``localrc`` with ``DEFAULT_INSTANCE_TYPE=m1.micro``
54
+    MI_NAME=m1.micro
54 55
 
55
-# Create micro flavor if not present
56
-if [[ -z $(nova flavor-list | grep $MI_NAME) ]]; then
57
-    nova flavor-create $MI_NAME 6 128 0 1
58
-fi
56
+    # Create micro flavor if not present
57
+    if [[ -z $(nova flavor-list | grep $MI_NAME) ]]; then
58
+        nova flavor-create $MI_NAME 6 128 0 1
59
+    fi
59 60
 
60 61
 
61
-# Other Uses
62
-# ----------
62
+    # Other Uses
63
+    # ----------
63 64
 
64
-# Add tcp/22 and icmp to default security group
65
-nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
66
-nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
65
+    # Add tcp/22 and icmp to default security group
66
+    nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
67
+    nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
67 68
 
69
+fi
68 70
deleted file mode 100644
... ...
@@ -1,90 +0,0 @@
1
-# Sample ``localrc`` for user-configurable variables in ``stack.sh``
2
-
3
-# NOTE: Copy this file to the root ``devstack`` directory for it to
4
-# work properly.
5
-
6
-# ``localrc`` is a user-maintained setings file that is sourced from ``stackrc``.
7
-# This gives it the ability to override any variables set in ``stackrc``.
8
-# Also, most of the settings in ``stack.sh`` are written to only be set if no
9
-# value has already been set; this lets ``localrc`` effectively override the
10
-# default values.
11
-
12
-# This is a collection of some of the settings we have found to be useful
13
-# in our DevStack development environments. Additional settings are described
14
-# in http://devstack.org/localrc.html
15
-# These should be considered as samples and are unsupported DevStack code.
16
-
17
-
18
-# Minimal Contents
19
-# ----------------
20
-
21
-# While ``stack.sh`` is happy to run without ``localrc``, devlife is better when
22
-# there are a few minimal variables set:
23
-
24
-# If the ``*_PASSWORD`` variables are not set here you will be prompted to enter
25
-# values for them by ``stack.sh`` and they will be added to ``localrc``.
26
-ADMIN_PASSWORD=nomoresecrete
27
-MYSQL_PASSWORD=stackdb
28
-RABBIT_PASSWORD=stackqueue
29
-SERVICE_PASSWORD=$ADMIN_PASSWORD
30
-
31
-# ``HOST_IP`` should be set manually for best results if the NIC configuration
32
-# of the host is unusual, i.e. ``eth1`` has the default route but ``eth0`` is the
33
-# public interface.  It is auto-detected in ``stack.sh`` but often is indeterminate
34
-# on later runs due to the IP moving from an Ethernet interface to a bridge on
35
-# the host. Setting it here also makes it available for ``openrc`` to include
36
-# when setting ``OS_AUTH_URL``.
37
-# ``HOST_IP`` is not set by default.
38
-#HOST_IP=w.x.y.z
39
-
40
-
41
-# Logging
42
-# -------
43
-
44
-# By default ``stack.sh`` output only goes to the terminal where it runs.  It can
45
-# be configured to additionally log to a file by setting ``LOGFILE`` to the full
46
-# path of the destination log file.  A timestamp will be appended to the given name.
47
-LOGFILE=$DEST/logs/stack.sh.log
48
-
49
-# Old log files are automatically removed after 7 days to keep things neat.  Change
50
-# the number of days by setting ``LOGDAYS``.
51
-LOGDAYS=2
52
-
53
-# Nova logs will be colorized if ``SYSLOG`` is not set; turn this off by setting
54
-# ``LOG_COLOR`` false.
55
-#LOG_COLOR=False
56
-
57
-
58
-# Using milestone-proposed branches
59
-# ---------------------------------
60
-
61
-# Uncomment these to grab the milestone-proposed branches from the repos:
62
-#CINDER_BRANCH=milestone-proposed
63
-#GLANCE_BRANCH=milestone-proposed
64
-#HORIZON_BRANCH=milestone-proposed
65
-#KEYSTONE_BRANCH=milestone-proposed
66
-#KEYSTONECLIENT_BRANCH=milestone-proposed
67
-#NOVA_BRANCH=milestone-proposed
68
-#NOVACLIENT_BRANCH=milestone-proposed
69
-#NEUTRON_BRANCH=milestone-proposed
70
-#SWIFT_BRANCH=milestone-proposed
71
-
72
-
73
-# Swift
74
-# -----
75
-
76
-# Swift is now used as the back-end for the S3-like object store. If Nova's
77
-# objectstore (``n-obj`` in ``ENABLED_SERVICES``) is enabled, it will NOT
78
-# run if Swift is enabled. Setting the hash value is required and you will
79
-# be prompted for it if Swift is enabled so just set it to something already:
80
-SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
81
-
82
-# For development purposes the default of 3 replicas is usually not required.
83
-# Set this to 1 to save some resources:
84
-SWIFT_REPLICAS=1
85
-
86
-# The data for Swift is stored by default in (``$DEST/data/swift``),
87
-# or (``$DATA_DIR/swift``) if ``DATA_DIR`` has been set, and can be
88
-# moved by setting ``SWIFT_DATA_DIR``. The directory will be created
89
-# if it does not exist.
90
-SWIFT_DATA_DIR=$DEST/data