Browse code

Merge "Add options to enable using DHCP agent Metadata-proxy"

Jenkins authored on 2014/11/04 19:08:20
Showing 1 changed files
... ...
@@ -274,6 +274,14 @@ TUNNEL_ENDPOINT_IP=${TUNNEL_ENDPOINT_IP:-$HOST_IP}
274 274
 # Example: ``OVS_ENABLE_TUNNELING=True``
275 275
 OVS_ENABLE_TUNNELING=${OVS_ENABLE_TUNNELING:-$ENABLE_TENANT_TUNNELS}
276 276
 
277
+# Use DHCP agent for providing metadata service in the case of
278
+# without L3 agent (No Route Agent), set to True in localrc.
279
+ENABLE_ISOLATED_METADATA=${ENABLE_ISOLATED_METADATA:-False}
280
+
281
+# Add a static route as dhcp option, so the request to 169.254.169.254
282
+# will be able to reach through a route(DHCP agent)
283
+# This option require ENABLE_ISOLATED_METADATA = True
284
+ENABLE_METADATA_NETWORK=${ENABLE_METADATA_NETWORK:-False}
277 285
 # Neutron plugin specific functions
278 286
 # ---------------------------------
279 287
 
... ...
@@ -831,6 +839,17 @@ function _configure_neutron_dhcp_agent {
831 831
     iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
832 832
     iniset $Q_DHCP_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND"
833 833
 
834
+    if ! is_service_enabled q-l3; then
835
+        if [[ "$ENABLE_ISOLATED_METADATA" = "True" ]]; then
836
+            iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata $ENABLE_ISOLATED_METADATA
837
+            iniset $Q_DHCP_CONF_FILE DEFAULT enable_metadata_network $ENABLE_METADATA_NETWORK
838
+        else
839
+            if [[ "$ENABLE_METADATA_NETWORK" = "True" ]]; then
840
+                die "$LINENO" "Enable isolated metadata is a must for metadata network"
841
+            fi
842
+        fi
843
+    fi
844
+
834 845
     _neutron_setup_interface_driver $Q_DHCP_CONF_FILE
835 846
 
836 847
     neutron_plugin_configure_dhcp_agent