The current existing phases "post-config" and "extra" are not
sufficient to allow local.conf overrides to extra type services
because they run after the services are installed and configured.
This commit introduces a new phase called "post-extra" that runs
after these existing phases. With this change, users are able to
leverage local.conf to provide overridden options to services
like Tempest.
Change-Id: I5d758eebfda804dd1d8cbc3d5cc35ef4dcc8c96f
Closes-Bug: #1249085
| ... | ... |
@@ -326,6 +326,7 @@ The defined phases are: |
| 326 | 326 |
* **local** - extracts ``localrc`` from ``local.conf`` before ``stackrc`` is sourced |
| 327 | 327 |
* **post-config** - runs after the layer 2 services are configured and before they are started |
| 328 | 328 |
* **extra** - runs after services are started and before any files in ``extra.d`` are executed |
| 329 |
+* **post-extra** - runs after files in ``extra.d`` are executed |
|
| 329 | 330 |
|
| 330 | 331 |
The file is processed strictly in sequence; meta-sections may be specified more than once but if any settings are duplicated the last to appear in the file will be used. |
| 331 | 332 |
|
| ... | ... |
@@ -14,6 +14,9 @@ if is_service_enabled tempest; then |
| 14 | 14 |
echo_summary "Initializing Tempest" |
| 15 | 15 |
configure_tempest |
| 16 | 16 |
init_tempest |
| 17 |
+ elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then |
|
| 18 |
+ # local.conf Tempest option overrides |
|
| 19 |
+ : |
|
| 17 | 20 |
fi |
| 18 | 21 |
|
| 19 | 22 |
if [[ "$1" == "unstack" ]]; then |
| ... | ... |
@@ -19,10 +19,10 @@ sourced with one or more arguments, the first of which defines the hook phase: |
| 19 | 19 |
source: always called first in any of the scripts, used to set the |
| 20 | 20 |
initial defaults in a lib/* script or similar |
| 21 | 21 |
|
| 22 |
- stack: called by stack.sh. There are three possible values for |
|
| 22 |
+ stack: called by stack.sh. There are four possible values for |
|
| 23 | 23 |
the second arg to distinguish the phase stack.sh is in: |
| 24 | 24 |
|
| 25 |
- arg 2: install | post-config | extra |
|
| 25 |
+ arg 2: install | post-config | extra | post-extra |
|
| 26 | 26 |
|
| 27 | 27 |
unstack: called by unstack.sh |
| 28 | 28 |
|
| ... | ... |
@@ -1252,6 +1252,13 @@ if [[ -d $TOP_DIR/extras.d ]]; then |
| 1252 | 1252 |
done |
| 1253 | 1253 |
fi |
| 1254 | 1254 |
|
| 1255 |
+# Local Configuration |
|
| 1256 |
+# =================== |
|
| 1257 |
+ |
|
| 1258 |
+# Apply configuration from local.conf if it exists for layer 2 services |
|
| 1259 |
+# Phase: post-extra |
|
| 1260 |
+merge_config_group $TOP_DIR/local.conf post-extra |
|
| 1261 |
+ |
|
| 1255 | 1262 |
|
| 1256 | 1263 |
# Run local script |
| 1257 | 1264 |
# ================ |