Browse code

Add variable to specify additional parameters for the Neutron service.

This patch adds a new variable, Q_SRV_EXTRA_DEFAULT_OPTS, which can
override any parameter of the [DEFAULT] section of the neutron.conf
file. It can be used for example to define the number of DHCP agents
that should host a network:
Q_SRV_EXTRA_DEFAULT_OPTS=(dhcp_agents_per_network=2)

Change-Id: Ic34164457e64dec6ca8ec76be1772f998d100991

Simon Pasquier authored on 2013/07/09 23:59:12
Showing 2 changed files
... ...
@@ -122,13 +122,14 @@ In order to enable Neutron a single node setup, you'll need the following settin
122 122
 
123 123
 Then run `stack.sh` as normal.
124 124
 
125
-devstack supports adding specific Neutron configuration flags to both the Open vSwitch and LinuxBridge plugin configuration files. To make use of this feature, the following variables are defined and can be configured in your `localrc` file:
125
+devstack supports adding specific Neutron configuration flags to the service, Open vSwitch plugin and LinuxBridge plugin configuration files. To make use of this feature, the following variables are defined and can be configured in your `localrc` file:
126 126
 
127
-    Variable Name             Plugin Config File Section Modified
127
+    Variable Name             Config File  Section Modified
128 128
     -------------------------------------------------------------------------------------
129
-    Q_SRV_EXTRA_OPTS          `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge)
130
-    Q_AGENT_EXTRA_AGENT_OPTS  AGENT
131
-    Q_AGENT_EXTRA_SRV_OPTS    `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge)
129
+    Q_SRV_EXTRA_OPTS          Plugin       `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge)
130
+    Q_AGENT_EXTRA_AGENT_OPTS  Plugin       AGENT
131
+    Q_AGENT_EXTRA_SRV_OPTS    Plugin       `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge)
132
+    Q_SRV_EXTRA_DEFAULT_OPTS  Service      DEFAULT
132 133
 
133 134
 An example of using the variables in your `localrc` is below:
134 135
 
... ...
@@ -614,6 +614,14 @@ function _configure_neutron_service() {
614 614
     iniset $NEUTRON_CONF DEFAULT auth_strategy $Q_AUTH_STRATEGY
615 615
     _neutron_setup_keystone $NEUTRON_CONF keystone_authtoken
616 616
 
617
+    # Define extra "DEFAULT" configuration options when q-svc is configured by
618
+    # defining the array ``Q_SRV_EXTRA_DEFAULT_OPTS``.
619
+    # For Example: ``Q_SRV_EXTRA_DEFAULT_OPTS=(foo=true bar=2)``
620
+    for I in "${Q_SRV_EXTRA_DEFAULT_OPTS[@]}"; do
621
+        # Replace the first '=' with ' ' for iniset syntax
622
+        iniset $NEUTRON_CONF DEFAULT ${I/=/ }
623
+    done
624
+
617 625
     # Configure plugin
618 626
     neutron_plugin_configure_service
619 627
 }