Sean Dague | e263c82 | 2014-12-05 14:25:28 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 3 | # lib/neutron |
Joe Gordon | 2394605 | 2014-01-15 21:42:32 +0000 | [diff] [blame] | 4 | # functions - functions specific to neutron |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 5 | |
| 6 | # Dependencies: |
| 7 | # ``functions`` file |
| 8 | # ``DEST`` must be defined |
Stephan Renatus | e578eff | 2013-11-19 13:31:04 +0100 | [diff] [blame] | 9 | # ``STACK_USER`` must be defined |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 10 | |
| 11 | # ``stack.sh`` calls the entry points in this order: |
| 12 | # |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 13 | # - install_neutron_agent_packages |
YAMAMOTO Takashi | 1a669dc | 2015-02-05 11:54:12 +0900 | [diff] [blame] | 14 | # - install_neutronclient |
| 15 | # - install_neutron |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 16 | # - install_neutron_third_party |
| 17 | # - configure_neutron |
| 18 | # - init_neutron |
| 19 | # - configure_neutron_third_party |
| 20 | # - init_neutron_third_party |
| 21 | # - start_neutron_third_party |
| 22 | # - create_nova_conf_neutron |
YAMAMOTO Takashi | a1875b1 | 2017-02-23 05:44:22 +0900 | [diff] [blame] | 23 | # - configure_neutron_after_post_config |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 24 | # - start_neutron_service_and_check |
YAMAMOTO Takashi | 1a669dc | 2015-02-05 11:54:12 +0900 | [diff] [blame] | 25 | # - check_neutron_third_party_integration |
yunhong jiang | 0d6e992 | 2014-10-10 06:12:47 -0700 | [diff] [blame] | 26 | # - start_neutron_agents |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 27 | # - create_neutron_initial_network |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 28 | # |
| 29 | # ``unstack.sh`` calls the entry points in this order: |
| 30 | # |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 31 | # - stop_neutron |
yunhong jiang | 0d6e992 | 2014-10-10 06:12:47 -0700 | [diff] [blame] | 32 | # - stop_neutron_third_party |
| 33 | # - cleanup_neutron |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 34 | |
| 35 | # Functions in lib/neutron are classified into the following categories: |
| 36 | # |
| 37 | # - entry points (called from stack.sh or unstack.sh) |
| 38 | # - internal functions |
| 39 | # - neutron exercises |
| 40 | # - 3rd party programs |
| 41 | |
| 42 | |
| 43 | # Neutron Networking |
| 44 | # ------------------ |
| 45 | |
| 46 | # Make sure that neutron is enabled in ``ENABLED_SERVICES``. If you want |
| 47 | # to run Neutron on this host, make sure that q-svc is also in |
| 48 | # ``ENABLED_SERVICES``. |
| 49 | # |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 50 | # See "Neutron Network Configuration" below for additional variables |
| 51 | # that must be set in localrc for connectivity across hosts with |
| 52 | # Neutron. |
| 53 | # |
| 54 | # With Neutron networking the NETWORK_MANAGER variable is ignored. |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 55 | |
John Davidge | 21529a5 | 2014-06-30 09:55:11 -0400 | [diff] [blame] | 56 | # Settings |
| 57 | # -------- |
| 58 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 59 | |
| 60 | # Neutron Network Configuration |
| 61 | # ----------------------------- |
| 62 | |
Matthew Treinish | abde96a | 2016-05-12 19:26:20 -0400 | [diff] [blame] | 63 | deprecated "Using lib/neutron-legacy is deprecated, and it will be removed in the future" |
Armando Migliaccio | 7dbcfae | 2016-02-19 14:43:42 -0800 | [diff] [blame] | 64 | |
Sean Dague | f3b2f4c | 2017-04-13 10:11:48 -0400 | [diff] [blame] | 65 | if is_service_enabled tls-proxy; then |
Rob Crittenden | 18d4778 | 2014-03-19 17:47:42 -0400 | [diff] [blame] | 66 | Q_PROTOCOL="https" |
| 67 | fi |
| 68 | |
| 69 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 70 | # Set up default directories |
Sean Dague | e08ab10 | 2014-11-13 17:09:28 -0500 | [diff] [blame] | 71 | GITDIR["python-neutronclient"]=$DEST/python-neutronclient |
Sean Dague | 5cb1906 | 2014-11-01 01:37:45 +0100 | [diff] [blame] | 72 | |
Doug Wiegley | 93e682c | 2015-03-03 10:31:30 -0700 | [diff] [blame] | 73 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 74 | NEUTRON_DIR=$DEST/neutron |
Kyle Mestery | 20b839f | 2014-12-08 06:17:27 +0000 | [diff] [blame] | 75 | NEUTRON_FWAAS_DIR=$DEST/neutron-fwaas |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 76 | NEUTRON_AUTH_CACHE_DIR=${NEUTRON_AUTH_CACHE_DIR:-/var/cache/neutron} |
| 77 | |
| 78 | # Support entry points installation of console scripts |
| 79 | if [[ -d $NEUTRON_DIR/bin/neutron-server ]]; then |
| 80 | NEUTRON_BIN_DIR=$NEUTRON_DIR/bin |
Sean Dague | 3bdb922 | 2013-10-22 08:36:16 -0400 | [diff] [blame] | 81 | else |
| 82 | NEUTRON_BIN_DIR=$(get_python_exec_prefix) |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 83 | fi |
| 84 | |
| 85 | NEUTRON_CONF_DIR=/etc/neutron |
| 86 | NEUTRON_CONF=$NEUTRON_CONF_DIR/neutron.conf |
| 87 | export NEUTRON_TEST_CONFIG_FILE=${NEUTRON_TEST_CONFIG_FILE:-"$NEUTRON_CONF_DIR/debug.ini"} |
| 88 | |
Adam Gandelman | 7614d21 | 2014-08-11 14:27:50 -0700 | [diff] [blame] | 89 | # Agent binaries. Note, binary paths for other agents are set in per-service |
| 90 | # scripts in lib/neutron_plugins/services/ |
| 91 | AGENT_DHCP_BINARY="$NEUTRON_BIN_DIR/neutron-dhcp-agent" |
| 92 | AGENT_L3_BINARY=${AGENT_L3_BINARY:-"$NEUTRON_BIN_DIR/neutron-l3-agent"} |
| 93 | AGENT_META_BINARY="$NEUTRON_BIN_DIR/neutron-metadata-agent" |
| 94 | |
| 95 | # Agent config files. Note, plugin-specific Q_PLUGIN_CONF_FILE is set and |
| 96 | # loaded from per-plugin scripts in lib/neutron_plugins/ |
| 97 | Q_DHCP_CONF_FILE=$NEUTRON_CONF_DIR/dhcp_agent.ini |
| 98 | Q_L3_CONF_FILE=$NEUTRON_CONF_DIR/l3_agent.ini |
Adam Gandelman | 7614d21 | 2014-08-11 14:27:50 -0700 | [diff] [blame] | 99 | Q_META_CONF_FILE=$NEUTRON_CONF_DIR/metadata_agent.ini |
| 100 | |
Henry Gessau | 0fc1cc2 | 2014-07-06 22:54:34 -0400 | [diff] [blame] | 101 | # Default name for Neutron database |
| 102 | Q_DB_NAME=${Q_DB_NAME:-neutron} |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 103 | # Default Neutron Plugin |
Kyle Mestery | 6d23500 | 2013-09-18 20:27:08 +0000 | [diff] [blame] | 104 | Q_PLUGIN=${Q_PLUGIN:-ml2} |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 105 | # Default Neutron Port |
| 106 | Q_PORT=${Q_PORT:-9696} |
Rob Crittenden | 18d4778 | 2014-03-19 17:47:42 -0400 | [diff] [blame] | 107 | # Default Neutron Internal Port when using TLS proxy |
| 108 | Q_PORT_INT=${Q_PORT_INT:-19696} |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 109 | # Default Neutron Host |
| 110 | Q_HOST=${Q_HOST:-$SERVICE_HOST} |
Rob Crittenden | 18d4778 | 2014-03-19 17:47:42 -0400 | [diff] [blame] | 111 | # Default protocol |
| 112 | Q_PROTOCOL=${Q_PROTOCOL:-$SERVICE_PROTOCOL} |
Brian Haley | 180f5eb | 2015-06-16 13:14:31 -0400 | [diff] [blame] | 113 | # Default listen address |
| 114 | Q_LISTEN_ADDRESS=${Q_LISTEN_ADDRESS:-$SERVICE_LISTEN_ADDRESS} |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 115 | # Default admin username |
| 116 | Q_ADMIN_USERNAME=${Q_ADMIN_USERNAME:-neutron} |
| 117 | # Default auth strategy |
| 118 | Q_AUTH_STRATEGY=${Q_AUTH_STRATEGY:-keystone} |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 119 | # RHEL's support for namespaces requires using veths with ovs |
| 120 | Q_OVS_USE_VETH=${Q_OVS_USE_VETH:-False} |
| 121 | Q_USE_ROOTWRAP=${Q_USE_ROOTWRAP:-True} |
Yuriy Taraday | 2662395 | 2014-07-16 17:41:53 +0400 | [diff] [blame] | 122 | Q_USE_ROOTWRAP_DAEMON=$(trueorfalse True Q_USE_ROOTWRAP_DAEMON) |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 123 | # Meta data IP |
| 124 | Q_META_DATA_IP=${Q_META_DATA_IP:-$SERVICE_HOST} |
| 125 | # Allow Overlapping IP among subnets |
| 126 | Q_ALLOW_OVERLAPPING_IP=${Q_ALLOW_OVERLAPPING_IP:-True} |
Terry Wilson | f06c443 | 2014-05-20 10:54:51 -0500 | [diff] [blame] | 127 | Q_NOTIFY_NOVA_PORT_STATUS_CHANGES=${Q_NOTIFY_NOVA_PORT_STATUS_CHANGES:-True} |
| 128 | Q_NOTIFY_NOVA_PORT_DATA_CHANGES=${Q_NOTIFY_NOVA_PORT_DATA_CHANGES:-True} |
Aaron Rosen | cea32b1 | 2014-03-04 16:20:14 -0800 | [diff] [blame] | 129 | VIF_PLUGGING_IS_FATAL=${VIF_PLUGGING_IS_FATAL:-True} |
| 130 | VIF_PLUGGING_TIMEOUT=${VIF_PLUGGING_TIMEOUT:-300} |
Aaron Rosen | 4540d00 | 2013-10-24 13:59:33 -0700 | [diff] [blame] | 131 | |
YAMAMOTO Takashi | eede9dd | 2016-07-15 10:27:53 +0900 | [diff] [blame] | 132 | # The directory which contains files for Q_PLUGIN_EXTRA_CONF_FILES. |
| 133 | # /etc/neutron is assumed by many of devstack plugins. Do not change. |
| 134 | _Q_PLUGIN_EXTRA_CONF_PATH=/etc/neutron |
| 135 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 136 | # List of config file names in addition to the main plugin config file |
YAMAMOTO Takashi | eede9dd | 2016-07-15 10:27:53 +0900 | [diff] [blame] | 137 | # To add additional plugin config files, use ``neutron_server_config_add`` |
| 138 | # utility function. For example: |
| 139 | # |
| 140 | # ``neutron_server_config_add file1`` |
| 141 | # |
| 142 | # These config files are relative to ``/etc/neutron``. The above |
| 143 | # example would specify ``--config-file /etc/neutron/file1`` for |
| 144 | # neutron server. |
Sean Dague | afef8bf | 2017-03-06 14:07:23 -0500 | [diff] [blame] | 145 | declare -a -g Q_PLUGIN_EXTRA_CONF_FILES |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 146 | |
YAMAMOTO Takashi | eede9dd | 2016-07-15 10:27:53 +0900 | [diff] [blame] | 147 | # same as Q_PLUGIN_EXTRA_CONF_FILES, but with absolute path. |
Sean Dague | afef8bf | 2017-03-06 14:07:23 -0500 | [diff] [blame] | 148 | declare -a -g _Q_PLUGIN_EXTRA_CONF_FILES_ABS |
YAMAMOTO Takashi | eede9dd | 2016-07-15 10:27:53 +0900 | [diff] [blame] | 149 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 150 | |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 151 | Q_RR_CONF_FILE=$NEUTRON_CONF_DIR/rootwrap.conf |
| 152 | if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then |
| 153 | Q_RR_COMMAND="sudo" |
| 154 | else |
| 155 | NEUTRON_ROOTWRAP=$(get_rootwrap_location neutron) |
| 156 | Q_RR_COMMAND="sudo $NEUTRON_ROOTWRAP $Q_RR_CONF_FILE" |
Yuriy Taraday | 2662395 | 2014-07-16 17:41:53 +0400 | [diff] [blame] | 157 | if [[ "$Q_USE_ROOTWRAP_DAEMON" == "True" ]]; then |
| 158 | Q_RR_DAEMON_COMMAND="sudo $NEUTRON_ROOTWRAP-daemon $Q_RR_CONF_FILE" |
| 159 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 160 | fi |
| 161 | |
Brian Haley | eea7621 | 2014-06-27 11:45:50 -0400 | [diff] [blame] | 162 | |
| 163 | # Distributed Virtual Router (DVR) configuration |
| 164 | # Can be: |
Dean Troyer | 3324f19 | 2014-09-18 09:26:39 -0500 | [diff] [blame] | 165 | # - ``legacy`` - No DVR functionality |
| 166 | # - ``dvr_snat`` - Controller or single node DVR |
| 167 | # - ``dvr`` - Compute node in multi-node DVR |
| 168 | # |
Brian Haley | eea7621 | 2014-06-27 11:45:50 -0400 | [diff] [blame] | 169 | Q_DVR_MODE=${Q_DVR_MODE:-legacy} |
| 170 | if [[ "$Q_DVR_MODE" != "legacy" ]]; then |
| 171 | Q_ML2_PLUGIN_MECHANISM_DRIVERS=openvswitch,linuxbridge,l2population |
| 172 | fi |
| 173 | |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 174 | # Provider Network Configurations |
| 175 | # -------------------------------- |
| 176 | |
YAMAMOTO Takashi | 15130cd | 2014-10-28 11:49:58 +0900 | [diff] [blame] | 177 | # The following variables control the Neutron ML2 plugins' allocation |
| 178 | # of tenant networks and availability of provider networks. If these |
| 179 | # are not configured in ``localrc``, tenant networks will be local to |
| 180 | # the host (with no remote connectivity), and no physical resources |
| 181 | # will be available for the allocation of provider networks. |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 182 | |
Attila Fazekas | 8feaf6c | 2014-07-27 20:47:04 +0200 | [diff] [blame] | 183 | # To disable tunnels (GRE or VXLAN) for tenant networks, |
| 184 | # set to False in ``local.conf``. |
| 185 | # GRE tunnels are only supported by the openvswitch. |
| 186 | ENABLE_TENANT_TUNNELS=${ENABLE_TENANT_TUNNELS:-True} |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 187 | |
Richard Theis | 8906b48 | 2016-06-08 10:28:37 -0500 | [diff] [blame] | 188 | # If using GRE, VXLAN or GENEVE tunnels for tenant networks, |
| 189 | # specify the range of IDs from which tenant networks are |
| 190 | # allocated. Can be overridden in ``localrc`` if necessary. |
Anant Patil | 3827dc0 | 2014-07-03 21:38:16 +0530 | [diff] [blame] | 191 | TENANT_TUNNEL_RANGES=${TENANT_TUNNEL_RANGES:-1:1000} |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 192 | |
| 193 | # To use VLANs for tenant networks, set to True in localrc. VLANs |
YAMAMOTO Takashi | 15130cd | 2014-10-28 11:49:58 +0900 | [diff] [blame] | 194 | # are supported by the ML2 plugins, requiring additional configuration |
| 195 | # described below. |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 196 | ENABLE_TENANT_VLANS=${ENABLE_TENANT_VLANS:-False} |
| 197 | |
| 198 | # If using VLANs for tenant networks, set in ``localrc`` to specify |
| 199 | # the range of VLAN VIDs from which tenant networks are |
| 200 | # allocated. An external network switch must be configured to |
| 201 | # trunk these VLANs between hosts for multi-host connectivity. |
| 202 | # |
| 203 | # Example: ``TENANT_VLAN_RANGE=1000:1999`` |
| 204 | TENANT_VLAN_RANGE=${TENANT_VLAN_RANGE:-} |
| 205 | |
| 206 | # If using VLANs for tenant networks, or if using flat or VLAN |
| 207 | # provider networks, set in ``localrc`` to the name of the physical |
| 208 | # network, and also configure ``OVS_PHYSICAL_BRIDGE`` for the |
| 209 | # openvswitch agent or ``LB_PHYSICAL_INTERFACE`` for the linuxbridge |
| 210 | # agent, as described below. |
| 211 | # |
| 212 | # Example: ``PHYSICAL_NETWORK=default`` |
Kevin Benton | 1554ade | 2016-07-22 09:40:19 -0700 | [diff] [blame] | 213 | PHYSICAL_NETWORK=${PHYSICAL_NETWORK:-public} |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 214 | |
YAMAMOTO Takashi | 15130cd | 2014-10-28 11:49:58 +0900 | [diff] [blame] | 215 | # With the openvswitch agent, if using VLANs for tenant networks, |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 216 | # or if using flat or VLAN provider networks, set in ``localrc`` to |
| 217 | # the name of the OVS bridge to use for the physical network. The |
| 218 | # bridge will be created if it does not already exist, but a |
| 219 | # physical interface must be manually added to the bridge as a |
| 220 | # port for external connectivity. |
| 221 | # |
| 222 | # Example: ``OVS_PHYSICAL_BRIDGE=br-eth1`` |
Kevin Benton | 1554ade | 2016-07-22 09:40:19 -0700 | [diff] [blame] | 223 | OVS_PHYSICAL_BRIDGE=${OVS_PHYSICAL_BRIDGE:-br-ex} |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 224 | |
Clark Boylan | 9546903 | 2016-09-08 17:08:36 -0700 | [diff] [blame] | 225 | default_route_dev=$(ip route | grep ^default | awk '{print $5}') |
| 226 | die_if_not_set $LINENO default_route_dev "Failure retrieving default route device" |
YAMAMOTO Takashi | 15130cd | 2014-10-28 11:49:58 +0900 | [diff] [blame] | 227 | # With the linuxbridge agent, if using VLANs for tenant networks, |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 228 | # or if using flat or VLAN provider networks, set in ``localrc`` to |
| 229 | # the name of the network interface to use for the physical |
| 230 | # network. |
| 231 | # |
| 232 | # Example: ``LB_PHYSICAL_INTERFACE=eth1`` |
Clark Boylan | 9546903 | 2016-09-08 17:08:36 -0700 | [diff] [blame] | 233 | LB_PHYSICAL_INTERFACE=${LB_PHYSICAL_INTERFACE:-$default_route_dev} |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 234 | |
Edgar Magana | 6f335b9 | 2014-07-10 15:42:44 -0700 | [diff] [blame] | 235 | # When Neutron tunnels are enabled it is needed to specify the |
| 236 | # IP address of the end point in the local server. This IP is set |
| 237 | # by default to the same IP address that the HOST IP. |
| 238 | # This variable can be used to specify a different end point IP address |
| 239 | # Example: ``TUNNEL_ENDPOINT_IP=1.1.1.1`` |
| 240 | TUNNEL_ENDPOINT_IP=${TUNNEL_ENDPOINT_IP:-$HOST_IP} |
| 241 | |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 242 | # With the openvswitch plugin, set to True in ``localrc`` to enable |
| 243 | # provider GRE tunnels when ``ENABLE_TENANT_TUNNELS`` is False. |
| 244 | # |
| 245 | # Example: ``OVS_ENABLE_TUNNELING=True`` |
| 246 | OVS_ENABLE_TUNNELING=${OVS_ENABLE_TUNNELING:-$ENABLE_TENANT_TUNNELS} |
| 247 | |
Tan Lin | 27a196e | 2014-10-31 15:44:34 +0800 | [diff] [blame] | 248 | # Use DHCP agent for providing metadata service in the case of |
| 249 | # without L3 agent (No Route Agent), set to True in localrc. |
| 250 | ENABLE_ISOLATED_METADATA=${ENABLE_ISOLATED_METADATA:-False} |
| 251 | |
| 252 | # Add a static route as dhcp option, so the request to 169.254.169.254 |
| 253 | # will be able to reach through a route(DHCP agent) |
| 254 | # This option require ENABLE_ISOLATED_METADATA = True |
| 255 | ENABLE_METADATA_NETWORK=${ENABLE_METADATA_NETWORK:-False} |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 256 | # Neutron plugin specific functions |
| 257 | # --------------------------------- |
| 258 | |
| 259 | # Please refer to ``lib/neutron_plugins/README.md`` for details. |
Hirofumi Ichihara | 36daecd | 2015-07-23 17:50:40 +0900 | [diff] [blame] | 260 | if [ -f $TOP_DIR/lib/neutron_plugins/$Q_PLUGIN ]; then |
| 261 | source $TOP_DIR/lib/neutron_plugins/$Q_PLUGIN |
| 262 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 263 | |
Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame] | 264 | # Agent metering service plugin functions |
| 265 | # ------------------------------------------- |
| 266 | |
| 267 | # Hardcoding for 1 service plugin for now |
| 268 | source $TOP_DIR/lib/neutron_plugins/services/metering |
| 269 | |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 270 | # L3 Service functions |
| 271 | source $TOP_DIR/lib/neutron_plugins/services/l3 |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 272 | # Use security group or not |
| 273 | if has_neutron_plugin_security_group; then |
| 274 | Q_USE_SECGROUP=${Q_USE_SECGROUP:-True} |
| 275 | else |
| 276 | Q_USE_SECGROUP=False |
| 277 | fi |
| 278 | |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 279 | # Save trace setting |
Ian Wienand | 523f488 | 2015-10-13 11:03:03 +1100 | [diff] [blame] | 280 | _XTRACE_NEUTRON=$(set +o | grep xtrace) |
Dean Troyer | e2907b4 | 2014-02-26 17:35:37 -0600 | [diff] [blame] | 281 | set +o xtrace |
| 282 | |
| 283 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 284 | # Functions |
| 285 | # --------- |
| 286 | |
Adam Gandelman | 7614d21 | 2014-08-11 14:27:50 -0700 | [diff] [blame] | 287 | function _determine_config_server { |
YAMAMOTO Takashi | eede9dd | 2016-07-15 10:27:53 +0900 | [diff] [blame] | 288 | if [[ "$Q_PLUGIN_EXTRA_CONF_PATH" != '' ]]; then |
| 289 | if [[ "$Q_PLUGIN_EXTRA_CONF_PATH" = "$_Q_PLUGIN_EXTRA_CONF_PATH" ]]; then |
| 290 | deprecated "Q_PLUGIN_EXTRA_CONF_PATH is deprecated" |
| 291 | else |
| 292 | die $LINENO "Q_PLUGIN_EXTRA_CONF_PATH is deprecated" |
| 293 | fi |
| 294 | fi |
| 295 | if [[ ${#Q_PLUGIN_EXTRA_CONF_FILES[@]} > 0 ]]; then |
| 296 | deprecated "Q_PLUGIN_EXTRA_CONF_FILES is deprecated. Use neutron_server_config_add instead." |
| 297 | fi |
| 298 | for cfg_file in ${Q_PLUGIN_EXTRA_CONF_FILES[@]}; do |
| 299 | _Q_PLUGIN_EXTRA_CONF_FILES_ABS+=($_Q_PLUGIN_EXTRA_CONF_PATH/$cfg_file) |
| 300 | done |
| 301 | |
Adam Gandelman | 7614d21 | 2014-08-11 14:27:50 -0700 | [diff] [blame] | 302 | local cfg_file |
| 303 | local opts="--config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE" |
YAMAMOTO Takashi | eede9dd | 2016-07-15 10:27:53 +0900 | [diff] [blame] | 304 | for cfg_file in ${_Q_PLUGIN_EXTRA_CONF_FILES_ABS[@]}; do |
Tom Patzig | 7346704 | 2016-04-19 17:02:34 +0200 | [diff] [blame] | 305 | opts+=" --config-file $cfg_file" |
Adam Gandelman | 7614d21 | 2014-08-11 14:27:50 -0700 | [diff] [blame] | 306 | done |
| 307 | echo "$opts" |
| 308 | } |
| 309 | |
Adam Gandelman | 7614d21 | 2014-08-11 14:27:50 -0700 | [diff] [blame] | 310 | function _determine_config_l3 { |
Angus Lees | a1c70f2 | 2016-05-31 14:43:14 +1000 | [diff] [blame] | 311 | local opts="--config-file $NEUTRON_CONF --config-file $Q_L3_CONF_FILE" |
Adam Gandelman | 7614d21 | 2014-08-11 14:27:50 -0700 | [diff] [blame] | 312 | echo "$opts" |
| 313 | } |
| 314 | |
| 315 | # For services and agents that require it, dynamically construct a list of |
| 316 | # --config-file arguments that are passed to the binary. |
| 317 | function determine_config_files { |
| 318 | local opts="" |
| 319 | case "$1" in |
| 320 | "neutron-server") opts="$(_determine_config_server)" ;; |
Adam Gandelman | 7614d21 | 2014-08-11 14:27:50 -0700 | [diff] [blame] | 321 | "neutron-l3-agent") opts="$(_determine_config_l3)" ;; |
| 322 | esac |
| 323 | if [ -z "$opts" ] ; then |
| 324 | die $LINENO "Could not determine config files for $1." |
| 325 | fi |
| 326 | echo "$opts" |
| 327 | } |
| 328 | |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 329 | # configure_mutnauq() |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 330 | # Set common config for all neutron server and agents. |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 331 | function configure_mutnauq { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 332 | _configure_neutron_common |
Brant Knudson | 2dd110c | 2015-03-14 12:39:14 -0500 | [diff] [blame] | 333 | iniset_rpc_backend neutron $NEUTRON_CONF |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 334 | |
Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame] | 335 | if is_service_enabled q-metering; then |
| 336 | _configure_neutron_metering |
| 337 | fi |
Stephen Ma | 9b38eb2 | 2014-04-02 02:13:09 +0000 | [diff] [blame] | 338 | if is_service_enabled q-agt q-svc; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 339 | _configure_neutron_service |
| 340 | fi |
| 341 | if is_service_enabled q-agt; then |
| 342 | _configure_neutron_plugin_agent |
| 343 | fi |
| 344 | if is_service_enabled q-dhcp; then |
| 345 | _configure_neutron_dhcp_agent |
| 346 | fi |
| 347 | if is_service_enabled q-l3; then |
| 348 | _configure_neutron_l3_agent |
| 349 | fi |
| 350 | if is_service_enabled q-meta; then |
| 351 | _configure_neutron_metadata_agent |
| 352 | fi |
| 353 | |
Brian Haley | eea7621 | 2014-06-27 11:45:50 -0400 | [diff] [blame] | 354 | if [[ "$Q_DVR_MODE" != "legacy" ]]; then |
| 355 | _configure_dvr |
| 356 | fi |
Dina Belova | 58adaa6 | 2014-07-11 18:18:12 +0400 | [diff] [blame] | 357 | if is_service_enabled ceilometer; then |
| 358 | _configure_neutron_ceilometer_notifications |
| 359 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 360 | |
armando-migliaccio | e155b89 | 2015-06-12 08:55:02 -0700 | [diff] [blame] | 361 | iniset $NEUTRON_CONF DEFAULT api_workers "$API_WORKERS" |
Armando Migliaccio | 06f2ea2 | 2017-02-02 16:47:00 -0800 | [diff] [blame] | 362 | # devstack is not a tool for running uber scale OpenStack |
| 363 | # clouds, therefore running without a dedicated RPC worker |
| 364 | # for state reports is more than adequate. |
| 365 | iniset $NEUTRON_CONF DEFAULT rpc_state_report_workers 0 |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 366 | } |
| 367 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 368 | function create_nova_conf_neutron { |
Sean Dague | f21cc1f | 2016-03-04 11:08:32 -0500 | [diff] [blame] | 369 | iniset $NOVA_CONF DEFAULT use_neutron True |
Matthew Kassawara | 28af796 | 2016-02-10 19:04:08 +0000 | [diff] [blame] | 370 | iniset $NOVA_CONF neutron auth_type "password" |
Sean Dague | c13b8a1 | 2017-04-20 06:54:51 -0400 | [diff] [blame] | 371 | iniset $NOVA_CONF neutron auth_url "$KEYSTONE_AUTH_URI" |
Jamie Lennox | 394968f | 2015-08-28 09:18:26 +1000 | [diff] [blame] | 372 | iniset $NOVA_CONF neutron username "$Q_ADMIN_USERNAME" |
| 373 | iniset $NOVA_CONF neutron password "$SERVICE_PASSWORD" |
Jamie Lennox | cbcbd8f | 2016-01-21 16:08:14 -0600 | [diff] [blame] | 374 | iniset $NOVA_CONF neutron user_domain_name "$SERVICE_DOMAIN_NAME" |
Sean Dague | 7580a0c | 2016-02-17 06:23:36 -0500 | [diff] [blame] | 375 | iniset $NOVA_CONF neutron project_name "$SERVICE_PROJECT_NAME" |
Jamie Lennox | cbcbd8f | 2016-01-21 16:08:14 -0600 | [diff] [blame] | 376 | iniset $NOVA_CONF neutron project_domain_name "$SERVICE_DOMAIN_NAME" |
Gary Kotton | 13d385e | 2014-06-17 23:24:53 -0700 | [diff] [blame] | 377 | iniset $NOVA_CONF neutron auth_strategy "$Q_AUTH_STRATEGY" |
Bartosz Górski | 0abde39 | 2014-02-28 14:15:19 +0100 | [diff] [blame] | 378 | iniset $NOVA_CONF neutron region_name "$REGION_NAME" |
Rob Crittenden | 18d4778 | 2014-03-19 17:47:42 -0400 | [diff] [blame] | 379 | iniset $NOVA_CONF neutron url "${Q_PROTOCOL}://$Q_HOST:$Q_PORT" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 380 | |
| 381 | if [[ "$Q_USE_SECGROUP" == "True" ]]; then |
| 382 | LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver |
Jeff Peeler | 1143f7e | 2013-10-31 16:21:52 -0400 | [diff] [blame] | 383 | iniset $NOVA_CONF DEFAULT firewall_driver $LIBVIRT_FIREWALL_DRIVER |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 384 | fi |
| 385 | |
Matt Riedemann | 925c256 | 2015-08-25 13:40:25 -0700 | [diff] [blame] | 386 | # optionally set options in nova_conf |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 387 | neutron_plugin_create_nova_conf |
| 388 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 389 | if is_service_enabled q-meta; then |
Gary Kotton | dd74550 | 2014-08-11 23:38:47 -0700 | [diff] [blame] | 390 | iniset $NOVA_CONF neutron service_metadata_proxy "True" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 391 | fi |
Aaron Rosen | cea32b1 | 2014-03-04 16:20:14 -0800 | [diff] [blame] | 392 | |
| 393 | iniset $NOVA_CONF DEFAULT vif_plugging_is_fatal "$VIF_PLUGGING_IS_FATAL" |
| 394 | iniset $NOVA_CONF DEFAULT vif_plugging_timeout "$VIF_PLUGGING_TIMEOUT" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 395 | } |
| 396 | |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 397 | # create_mutnauq_accounts() - Set up common required neutron accounts |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 398 | |
| 399 | # Tenant User Roles |
| 400 | # ------------------------------------------------------------------ |
| 401 | # service neutron admin # if enabled |
| 402 | |
| 403 | # Migrated from keystone_data.sh |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 404 | function create_mutnauq_accounts { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 405 | if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then |
Bartosz Górski | 0abde39 | 2014-02-28 14:15:19 +0100 | [diff] [blame] | 406 | |
Jamie Lennox | 85ff532 | 2015-01-28 14:28:01 +1000 | [diff] [blame] | 407 | create_service_user "neutron" |
Bartosz Górski | 0abde39 | 2014-02-28 14:15:19 +0100 | [diff] [blame] | 408 | |
Sean Dague | 985e958 | 2016-02-10 07:25:24 -0500 | [diff] [blame] | 409 | get_or_create_service "neutron" "network" "Neutron Service" |
Matt Riedemann | ae4578b | 2016-04-23 01:45:40 +0000 | [diff] [blame] | 410 | get_or_create_endpoint \ |
Sean Dague | 985e958 | 2016-02-10 07:25:24 -0500 | [diff] [blame] | 411 | "network" \ |
| 412 | "$REGION_NAME" \ |
Sean Dague | 985e958 | 2016-02-10 07:25:24 -0500 | [diff] [blame] | 413 | "$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 414 | fi |
| 415 | } |
| 416 | |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 417 | # init_mutnauq() - Initialize databases, etc. |
| 418 | function init_mutnauq { |
Ihar Hrachyshka | 157c84b | 2014-10-06 13:29:39 +0200 | [diff] [blame] | 419 | recreate_database $Q_DB_NAME |
Clark Boylan | 633dbc3 | 2017-06-14 12:09:21 -0700 | [diff] [blame^] | 420 | time_start "dbsync" |
Salvatore Orlando | dd64988 | 2013-08-05 08:56:17 -0700 | [diff] [blame] | 421 | # Run Neutron db migrations |
| 422 | $NEUTRON_BIN_DIR/neutron-db-manage --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE upgrade head |
Clark Boylan | 633dbc3 | 2017-06-14 12:09:21 -0700 | [diff] [blame^] | 423 | time_stop "dbsync" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 424 | } |
| 425 | |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 426 | # install_mutnauq() - Collect source and prepare |
| 427 | function install_mutnauq { |
Doug Wiegley | 86561c3 | 2016-02-10 18:37:21 -0700 | [diff] [blame] | 428 | # Install neutron-lib from git so we make sure we're testing |
| 429 | # the latest code. |
| 430 | if use_library_from_git "neutron-lib"; then |
| 431 | git_clone_by_name "neutron-lib" |
| 432 | setup_dev_lib "neutron-lib" |
| 433 | fi |
| 434 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 435 | git_clone $NEUTRON_REPO $NEUTRON_DIR $NEUTRON_BRANCH |
| 436 | setup_develop $NEUTRON_DIR |
| 437 | } |
| 438 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 439 | # install_neutron_agent_packages() - Collect source and prepare |
YAMAMOTO Takashi | c74315e | 2016-07-21 17:49:43 +0900 | [diff] [blame] | 440 | function install_neutron_agent_packages_mutnauq { |
Robert Li | 72b3e44 | 2014-07-17 15:04:52 -0400 | [diff] [blame] | 441 | # radvd doesn't come with the OS. Install it if the l3 service is enabled. |
| 442 | if is_service_enabled q-l3; then |
| 443 | install_package radvd |
| 444 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 445 | # install packages that are specific to plugin agent(s) |
| 446 | if is_service_enabled q-agt q-dhcp q-l3; then |
| 447 | neutron_plugin_install_agent_packages |
| 448 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 449 | } |
| 450 | |
YAMAMOTO Takashi | a1875b1 | 2017-02-23 05:44:22 +0900 | [diff] [blame] | 451 | # Finish neutron configuration |
| 452 | function configure_neutron_after_post_config { |
| 453 | if [[ $Q_SERVICE_PLUGIN_CLASSES != '' ]]; then |
| 454 | iniset $NEUTRON_CONF DEFAULT service_plugins $Q_SERVICE_PLUGIN_CLASSES |
| 455 | fi |
| 456 | } |
| 457 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 458 | # Start running processes, including screen |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 459 | function start_neutron_service_and_check { |
Rob Crittenden | 18d4778 | 2014-03-19 17:47:42 -0400 | [diff] [blame] | 460 | local service_port=$Q_PORT |
| 461 | local service_protocol=$Q_PROTOCOL |
Ian Wienand | 7ae9729 | 2016-02-16 14:50:53 +1100 | [diff] [blame] | 462 | local cfg_file_options |
| 463 | |
| 464 | cfg_file_options="$(determine_config_files neutron-server)" |
| 465 | |
Rob Crittenden | 18d4778 | 2014-03-19 17:47:42 -0400 | [diff] [blame] | 466 | if is_service_enabled tls-proxy; then |
| 467 | service_port=$Q_PORT_INT |
| 468 | service_protocol="http" |
| 469 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 470 | # Start the Neutron service |
Davanum Srinivas | 59756e9 | 2015-09-23 17:42:54 -0400 | [diff] [blame] | 471 | run_process q-svc "$NEUTRON_BIN_DIR/neutron-server $cfg_file_options" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 472 | echo "Waiting for Neutron to start..." |
Sean Dague | 442e4e9 | 2015-06-24 13:24:02 -0400 | [diff] [blame] | 473 | |
| 474 | local testcmd="wget ${ssl_ca} --no-proxy -q -O- $service_protocol://$Q_HOST:$service_port" |
| 475 | test_with_retry "$testcmd" "Neutron did not start" $SERVICE_TIMEOUT |
| 476 | |
Rob Crittenden | 18d4778 | 2014-03-19 17:47:42 -0400 | [diff] [blame] | 477 | # Start proxy if enabled |
| 478 | if is_service_enabled tls-proxy; then |
Gregory Haynes | 4b49e40 | 2016-08-31 18:19:51 -0700 | [diff] [blame] | 479 | start_tls_proxy neutron '*' $Q_PORT $Q_HOST $Q_PORT_INT |
Rob Crittenden | 18d4778 | 2014-03-19 17:47:42 -0400 | [diff] [blame] | 480 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 481 | } |
| 482 | |
Russell Bryant | 09b9460 | 2015-06-08 15:25:43 -0400 | [diff] [blame] | 483 | # Control of the l2 agent is separated out to make it easier to test partial |
| 484 | # upgrades (everything upgraded except the L2 agent) |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 485 | function start_mutnauq_l2_agent { |
Davanum Srinivas | 59756e9 | 2015-09-23 17:42:54 -0400 | [diff] [blame] | 486 | run_process q-agt "$AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE" |
Nachi Ueno | 584750f | 2013-07-15 18:22:21 -0700 | [diff] [blame] | 487 | |
Kahou Lei | d663e29 | 2015-10-24 12:18:57 -0700 | [diff] [blame] | 488 | if is_provider_network && [[ $Q_AGENT == "openvswitch" ]]; then |
Zhongyue Luo | 56b7efb | 2014-12-16 11:36:49 +0800 | [diff] [blame] | 489 | sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_PHYSICAL_BRIDGE $PUBLIC_INTERFACE |
Sean M. Collins | 5ec6f8f | 2014-05-14 17:01:03 -0400 | [diff] [blame] | 490 | sudo ip link set $OVS_PHYSICAL_BRIDGE up |
| 491 | sudo ip link set br-int up |
| 492 | sudo ip link set $PUBLIC_INTERFACE up |
yunhong jiang | ae9ee6b | 2014-10-08 07:01:02 -0700 | [diff] [blame] | 493 | if is_ironic_hardware; then |
| 494 | for IP in $(ip addr show dev $PUBLIC_INTERFACE | grep ' inet ' | awk '{print $2}'); do |
| 495 | sudo ip addr del $IP dev $PUBLIC_INTERFACE |
| 496 | sudo ip addr add $IP dev $OVS_PHYSICAL_BRIDGE |
| 497 | done |
gong yong sheng | 348c6ac | 2015-06-23 14:03:47 +0800 | [diff] [blame] | 498 | sudo ip route replace $FIXED_RANGE via $NETWORK_GATEWAY dev $OVS_PHYSICAL_BRIDGE |
yunhong jiang | ae9ee6b | 2014-10-08 07:01:02 -0700 | [diff] [blame] | 499 | fi |
Sean M. Collins | 5ec6f8f | 2014-05-14 17:01:03 -0400 | [diff] [blame] | 500 | fi |
Russell Bryant | 09b9460 | 2015-06-08 15:25:43 -0400 | [diff] [blame] | 501 | } |
| 502 | |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 503 | function start_mutnauq_other_agents { |
Angus Lees | a1c70f2 | 2016-05-31 14:43:14 +1000 | [diff] [blame] | 504 | run_process q-dhcp "$AGENT_DHCP_BINARY --config-file $NEUTRON_CONF --config-file $Q_DHCP_CONF_FILE" |
Sean M. Collins | 5ec6f8f | 2014-05-14 17:01:03 -0400 | [diff] [blame] | 505 | |
Paul Michali | e4289c8 | 2015-08-14 11:49:27 -0400 | [diff] [blame] | 506 | if is_service_enabled neutron-vpnaas; then |
| 507 | : # Started by plugin |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 508 | else |
Davanum Srinivas | 59756e9 | 2015-09-23 17:42:54 -0400 | [diff] [blame] | 509 | run_process q-l3 "$AGENT_L3_BINARY $(determine_config_files neutron-l3-agent)" |
Ravi Chunduru | 95c93e2 | 2013-07-16 04:18:47 -0700 | [diff] [blame] | 510 | fi |
| 511 | |
Angus Lees | a1c70f2 | 2016-05-31 14:43:14 +1000 | [diff] [blame] | 512 | run_process q-meta "$AGENT_META_BINARY --config-file $NEUTRON_CONF --config-file $Q_META_CONF_FILE" |
Davanum Srinivas | 59756e9 | 2015-09-23 17:42:54 -0400 | [diff] [blame] | 513 | run_process q-metering "$AGENT_METERING_BINARY --config-file $NEUTRON_CONF --config-file $METERING_AGENT_CONF_FILENAME" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 514 | } |
| 515 | |
Russell Bryant | 09b9460 | 2015-06-08 15:25:43 -0400 | [diff] [blame] | 516 | # Start running processes, including screen |
| 517 | function start_neutron_agents { |
| 518 | # Start up the neutron agents if enabled |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 519 | start_mutnauq_l2_agent |
| 520 | start_mutnauq_other_agents |
Russell Bryant | 09b9460 | 2015-06-08 15:25:43 -0400 | [diff] [blame] | 521 | } |
| 522 | |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 523 | function stop_mutnauq_l2_agent { |
Russell Bryant | 09b9460 | 2015-06-08 15:25:43 -0400 | [diff] [blame] | 524 | stop_process q-agt |
| 525 | } |
| 526 | |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 527 | # stop_mutnauq_other() - Stop running processes (non-screen) |
| 528 | function stop_mutnauq_other { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 529 | if is_service_enabled q-dhcp; then |
Chris Dent | 36891dc | 2015-02-03 16:22:44 +0000 | [diff] [blame] | 530 | stop_process q-dhcp |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 531 | pid=$(ps aux | awk '/[d]nsmasq.+interface=(tap|ns-)/ { print $2 }') |
| 532 | [ ! -z "$pid" ] && sudo kill -9 $pid |
| 533 | fi |
Chris Dent | 36891dc | 2015-02-03 16:22:44 +0000 | [diff] [blame] | 534 | |
| 535 | stop_process q-svc |
Li Ma | a15d9de | 2016-01-19 19:11:51 +0800 | [diff] [blame] | 536 | |
| 537 | if is_service_enabled q-l3; then |
| 538 | sudo pkill -f "radvd -C $DATA_DIR/neutron/ra" |
| 539 | stop_process q-l3 |
| 540 | fi |
Chris Dent | 36891dc | 2015-02-03 16:22:44 +0000 | [diff] [blame] | 541 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 542 | if is_service_enabled q-meta; then |
Jakub Libosvar | 1f76328 | 2014-01-28 23:01:38 +0100 | [diff] [blame] | 543 | sudo pkill -9 -f neutron-ns-metadata-proxy || : |
Chris Dent | 36891dc | 2015-02-03 16:22:44 +0000 | [diff] [blame] | 544 | stop_process q-meta |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 545 | fi |
Akihiro Motoki | edddb1f | 2013-12-09 20:21:06 +0900 | [diff] [blame] | 546 | |
Akihiro Motoki | edddb1f | 2013-12-09 20:21:06 +0900 | [diff] [blame] | 547 | if is_service_enabled q-metering; then |
| 548 | neutron_metering_stop |
| 549 | fi |
Li Ma | 50120fa | 2015-12-13 10:41:34 +0800 | [diff] [blame] | 550 | |
| 551 | if [[ "$Q_USE_ROOTWRAP_DAEMON" == "True" ]]; then |
| 552 | sudo pkill -9 -f $NEUTRON_ROOTWRAP-daemon || : |
| 553 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 554 | } |
| 555 | |
Russell Bryant | 09b9460 | 2015-06-08 15:25:43 -0400 | [diff] [blame] | 556 | # stop_neutron() - Stop running processes (non-screen) |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 557 | function stop_mutnauq { |
| 558 | stop_mutnauq_other |
| 559 | stop_mutnauq_l2_agent |
Russell Bryant | 09b9460 | 2015-06-08 15:25:43 -0400 | [diff] [blame] | 560 | } |
| 561 | |
Sean M. Collins | 00e16a9 | 2015-02-20 11:45:21 -0500 | [diff] [blame] | 562 | # _move_neutron_addresses_route() - Move the primary IP to the OVS bridge |
Adam Kacmarsky | 6b172c8 | 2015-08-13 15:14:05 -0600 | [diff] [blame] | 563 | # on startup, or back to the public interface on cleanup. If no IP is |
| 564 | # configured on the interface, just add it as a port to the OVS bridge. |
Sean M. Collins | 00e16a9 | 2015-02-20 11:45:21 -0500 | [diff] [blame] | 565 | function _move_neutron_addresses_route { |
| 566 | local from_intf=$1 |
| 567 | local to_intf=$2 |
| 568 | local add_ovs_port=$3 |
Brian Haley | a0d1b01 | 2015-11-16 17:30:48 -0500 | [diff] [blame] | 569 | local del_ovs_port=$4 |
| 570 | local af=$5 |
Sean M. Collins | 00e16a9 | 2015-02-20 11:45:21 -0500 | [diff] [blame] | 571 | |
| 572 | if [[ -n "$from_intf" && -n "$to_intf" ]]; then |
| 573 | # Remove the primary IP address from $from_intf and add it to $to_intf, |
| 574 | # along with the default route, if it exists. Also, when called |
| 575 | # on configure we will also add $from_intf as a port on $to_intf, |
| 576 | # assuming it is an OVS bridge. |
| 577 | |
Matt McEuen | e24707b | 2016-07-11 08:37:59 -0500 | [diff] [blame] | 578 | local IP_REPLACE="" |
Adam Kacmarsky | 6b172c8 | 2015-08-13 15:14:05 -0600 | [diff] [blame] | 579 | local IP_DEL="" |
Shinobu KINJO | f95315b | 2015-11-07 10:21:08 +0900 | [diff] [blame] | 580 | local IP_UP="" |
Ian Wienand | ada886d | 2015-10-07 14:06:26 +1100 | [diff] [blame] | 581 | local DEFAULT_ROUTE_GW |
Andreas Scheuring | 92e6b1a | 2017-04-26 13:40:42 +0200 | [diff] [blame] | 582 | DEFAULT_ROUTE_GW=$(ip -f $af r | awk "/default.+$from_intf\s/ { print \$3; exit }") |
Sean M. Collins | 00e16a9 | 2015-02-20 11:45:21 -0500 | [diff] [blame] | 583 | local ADD_OVS_PORT="" |
Brian Haley | a0d1b01 | 2015-11-16 17:30:48 -0500 | [diff] [blame] | 584 | local DEL_OVS_PORT="" |
Sean M. Collins | 17398a3 | 2016-05-11 18:24:46 +0000 | [diff] [blame] | 585 | local ARP_CMD="" |
Sean M. Collins | 00e16a9 | 2015-02-20 11:45:21 -0500 | [diff] [blame] | 586 | |
Brian Haley | bb9caea | 2015-11-16 17:18:42 -0500 | [diff] [blame] | 587 | IP_BRD=$(ip -f $af a s dev $from_intf scope global primary | grep inet | awk '{ print $2, $3, $4; exit }') |
Adam Kacmarsky | 11298a0 | 2015-06-26 14:49:47 -0600 | [diff] [blame] | 588 | |
Sean M. Collins | 00e16a9 | 2015-02-20 11:45:21 -0500 | [diff] [blame] | 589 | if [ "$DEFAULT_ROUTE_GW" != "" ]; then |
Sean M. Collins | 59e86a3 | 2015-11-09 11:06:39 -0500 | [diff] [blame] | 590 | ADD_DEFAULT_ROUTE="sudo ip -f $af r replace default via $DEFAULT_ROUTE_GW dev $to_intf" |
Sean M. Collins | 00e16a9 | 2015-02-20 11:45:21 -0500 | [diff] [blame] | 591 | fi |
| 592 | |
| 593 | if [[ "$add_ovs_port" == "True" ]]; then |
Raman Budny | db02bbf | 2015-03-31 13:09:09 +0300 | [diff] [blame] | 594 | ADD_OVS_PORT="sudo ovs-vsctl --may-exist add-port $to_intf $from_intf" |
Sean M. Collins | 00e16a9 | 2015-02-20 11:45:21 -0500 | [diff] [blame] | 595 | fi |
| 596 | |
Brian Haley | a0d1b01 | 2015-11-16 17:30:48 -0500 | [diff] [blame] | 597 | if [[ "$del_ovs_port" == "True" ]]; then |
| 598 | DEL_OVS_PORT="sudo ovs-vsctl --if-exists del-port $from_intf $to_intf" |
| 599 | fi |
| 600 | |
Adam Kacmarsky | 6b172c8 | 2015-08-13 15:14:05 -0600 | [diff] [blame] | 601 | if [[ "$IP_BRD" != "" ]]; then |
Brian Haley | 9451021 | 2015-09-02 15:40:04 -0400 | [diff] [blame] | 602 | IP_DEL="sudo ip addr del $IP_BRD dev $from_intf" |
Matt McEuen | e24707b | 2016-07-11 08:37:59 -0500 | [diff] [blame] | 603 | IP_REPLACE="sudo ip addr replace $IP_BRD dev $to_intf" |
Shinobu KINJO | f95315b | 2015-11-07 10:21:08 +0900 | [diff] [blame] | 604 | IP_UP="sudo ip link set $to_intf up" |
Sean M. Collins | 6d4843e | 2016-05-12 16:14:26 -0400 | [diff] [blame] | 605 | if [[ "$af" == "inet" ]]; then |
| 606 | IP=$(echo $IP_BRD | awk '{ print $1; exit }' | grep -o -E '(.*)/' | cut -d "/" -f1) |
| 607 | ARP_CMD="arping -A -c 3 -w 4.5 -I $to_intf $IP " |
| 608 | fi |
Adam Kacmarsky | 6b172c8 | 2015-08-13 15:14:05 -0600 | [diff] [blame] | 609 | fi |
| 610 | |
Brian Haley | a0d1b01 | 2015-11-16 17:30:48 -0500 | [diff] [blame] | 611 | # The add/del OVS port calls have to happen either before or |
| 612 | # after the address is moved in order to not leave it orphaned. |
Matt McEuen | e24707b | 2016-07-11 08:37:59 -0500 | [diff] [blame] | 613 | $DEL_OVS_PORT; $IP_DEL; $IP_REPLACE; $IP_UP; $ADD_OVS_PORT; $ADD_DEFAULT_ROUTE; $ARP_CMD |
Sean M. Collins | 00e16a9 | 2015-02-20 11:45:21 -0500 | [diff] [blame] | 614 | fi |
| 615 | } |
| 616 | |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 617 | # cleanup_mutnauq() - Remove residual data files, anything left over from previous |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 618 | # runs that a clean run would need to clean up |
Sean M. Collins | 2a24251 | 2016-05-03 09:03:09 -0400 | [diff] [blame] | 619 | function cleanup_mutnauq { |
Sean M. Collins | 00e16a9 | 2015-02-20 11:45:21 -0500 | [diff] [blame] | 620 | |
Yalei Wang | 316b348 | 2015-07-15 21:00:31 +0800 | [diff] [blame] | 621 | if [[ -n "$OVS_PHYSICAL_BRIDGE" ]]; then |
Brian Haley | a0d1b01 | 2015-11-16 17:30:48 -0500 | [diff] [blame] | 622 | _move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False True "inet" |
Adam Kacmarsky | 11298a0 | 2015-06-26 14:49:47 -0600 | [diff] [blame] | 623 | |
Yalei Wang | 316b348 | 2015-07-15 21:00:31 +0800 | [diff] [blame] | 624 | if [[ $(ip -f inet6 a s dev "$OVS_PHYSICAL_BRIDGE" | grep -c 'global') != 0 ]]; then |
Sean M. Collins | 790266f | 2015-11-11 13:36:35 -0500 | [diff] [blame] | 625 | # ip(8) wants the prefix length when deleting |
| 626 | local v6_gateway |
| 627 | v6_gateway=$(ip -6 a s dev $OVS_PHYSICAL_BRIDGE | grep $IPV6_PUBLIC_NETWORK_GATEWAY | awk '{ print $2 }') |
| 628 | sudo ip -6 addr del $v6_gateway dev $OVS_PHYSICAL_BRIDGE |
Brian Haley | a0d1b01 | 2015-11-16 17:30:48 -0500 | [diff] [blame] | 629 | _move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False False "inet6" |
Yalei Wang | 316b348 | 2015-07-15 21:00:31 +0800 | [diff] [blame] | 630 | fi |
Sean M. Collins | 00e16a9 | 2015-02-20 11:45:21 -0500 | [diff] [blame] | 631 | |
Yalei Wang | 316b348 | 2015-07-15 21:00:31 +0800 | [diff] [blame] | 632 | if is_provider_network && is_ironic_hardware; then |
| 633 | for IP in $(ip addr show dev $OVS_PHYSICAL_BRIDGE | grep ' inet ' | awk '{print $2}'); do |
| 634 | sudo ip addr del $IP dev $OVS_PHYSICAL_BRIDGE |
| 635 | sudo ip addr add $IP dev $PUBLIC_INTERFACE |
| 636 | done |
| 637 | sudo route del -net $FIXED_RANGE gw $NETWORK_GATEWAY dev $OVS_PHYSICAL_BRIDGE |
| 638 | fi |
yunhong jiang | ae9ee6b | 2014-10-08 07:01:02 -0700 | [diff] [blame] | 639 | fi |
| 640 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 641 | if is_neutron_ovs_base_plugin; then |
| 642 | neutron_ovs_base_cleanup |
| 643 | fi |
| 644 | |
Sean M. Collins | 7bc2af7 | 2015-06-08 12:36:30 -0400 | [diff] [blame] | 645 | if [[ $Q_AGENT == "linuxbridge" ]]; then |
| 646 | neutron_lb_cleanup |
| 647 | fi |
| 648 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 649 | # delete all namespaces created by neutron |
Doug Wiegley | 7e40c64 | 2016-08-20 16:32:14 +0000 | [diff] [blame] | 650 | for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|fip|snat)-[0-9a-f-]*'); do |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 651 | sudo ip netns delete ${ns} |
| 652 | done |
| 653 | } |
| 654 | |
Doug Wiegley | 93e682c | 2015-03-03 10:31:30 -0700 | [diff] [blame] | 655 | |
Maru Newby | 952fd90 | 2015-01-30 22:27:12 +0000 | [diff] [blame] | 656 | function _create_neutron_conf_dir { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 657 | # Put config files in ``NEUTRON_CONF_DIR`` for everyone to find |
Dean Troyer | 8421c2b | 2015-03-16 13:52:19 -0500 | [diff] [blame] | 658 | sudo install -d -o $STACK_USER $NEUTRON_CONF_DIR |
Maru Newby | 952fd90 | 2015-01-30 22:27:12 +0000 | [diff] [blame] | 659 | } |
| 660 | |
| 661 | # _configure_neutron_common() |
| 662 | # Set common config for all neutron server and agents. |
| 663 | # This MUST be called before other ``_configure_neutron_*`` functions. |
| 664 | function _configure_neutron_common { |
| 665 | _create_neutron_conf_dir |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 666 | |
Martin Hickey | 30d5fae | 2015-11-10 13:44:15 +0000 | [diff] [blame] | 667 | # Uses oslo config generator to generate core sample configuration files |
| 668 | (cd $NEUTRON_DIR && exec ./tools/generate_config_file_samples.sh) |
| 669 | |
| 670 | cp $NEUTRON_DIR/etc/neutron.conf.sample $NEUTRON_CONF |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 671 | |
Jerry Zhao | 296c1e3 | 2015-08-07 20:43:54 -0400 | [diff] [blame] | 672 | Q_POLICY_FILE=$NEUTRON_CONF_DIR/policy.json |
| 673 | cp $NEUTRON_DIR/etc/policy.json $Q_POLICY_FILE |
| 674 | |
| 675 | # allow neutron user to administer neutron to match neutron account |
| 676 | sed -i 's/"context_is_admin": "role:admin"/"context_is_admin": "role:admin or user_name:neutron"/g' $Q_POLICY_FILE |
| 677 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 678 | # Set plugin-specific variables ``Q_DB_NAME``, ``Q_PLUGIN_CLASS``. |
| 679 | # For main plugin config file, set ``Q_PLUGIN_CONF_PATH``, ``Q_PLUGIN_CONF_FILENAME``. |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 680 | neutron_plugin_configure_common |
| 681 | |
sbauza | e2c4ee2 | 2013-08-29 17:29:46 +0200 | [diff] [blame] | 682 | if [[ "$Q_PLUGIN_CONF_PATH" == '' || "$Q_PLUGIN_CONF_FILENAME" == '' || "$Q_PLUGIN_CLASS" == '' ]]; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 683 | die $LINENO "Neutron plugin not set.. exiting" |
| 684 | fi |
| 685 | |
| 686 | # If needed, move config file from ``$NEUTRON_DIR/etc/neutron`` to ``NEUTRON_CONF_DIR`` |
| 687 | mkdir -p /$Q_PLUGIN_CONF_PATH |
| 688 | Q_PLUGIN_CONF_FILE=$Q_PLUGIN_CONF_PATH/$Q_PLUGIN_CONF_FILENAME |
Hirofumi Ichihara | 97cc85b | 2015-09-08 13:51:01 +0900 | [diff] [blame] | 689 | # NOTE(hichihara): Some neutron vendor plugins were already decomposed and |
| 690 | # there is no config file in Neutron tree. They should prepare the file in each plugin. |
Martin Hickey | 30d5fae | 2015-11-10 13:44:15 +0000 | [diff] [blame] | 691 | if [ -f "$NEUTRON_DIR/$Q_PLUGIN_CONF_FILE.sample" ]; then |
| 692 | cp "$NEUTRON_DIR/$Q_PLUGIN_CONF_FILE.sample" /$Q_PLUGIN_CONF_FILE |
| 693 | elif [ -f $NEUTRON_DIR/$Q_PLUGIN_CONF_FILE ]; then |
Hirofumi Ichihara | 97cc85b | 2015-09-08 13:51:01 +0900 | [diff] [blame] | 694 | cp $NEUTRON_DIR/$Q_PLUGIN_CONF_FILE /$Q_PLUGIN_CONF_FILE |
| 695 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 696 | |
Ihar Hrachyshka | b816e5d | 2014-07-21 13:53:50 +0200 | [diff] [blame] | 697 | iniset $NEUTRON_CONF database connection `database_connection_url $Q_DB_NAME` |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 698 | iniset $NEUTRON_CONF DEFAULT state_path $DATA_DIR/neutron |
salvatore | e4e535b | 2014-10-29 18:22:46 +0100 | [diff] [blame] | 699 | iniset $NEUTRON_CONF DEFAULT use_syslog $SYSLOG |
Brian Haley | 180f5eb | 2015-06-16 13:14:31 -0400 | [diff] [blame] | 700 | iniset $NEUTRON_CONF DEFAULT bind_host $Q_LISTEN_ADDRESS |
Martin Hickey | 30d5fae | 2015-11-10 13:44:15 +0000 | [diff] [blame] | 701 | iniset $NEUTRON_CONF oslo_concurrency lock_path $DATA_DIR/neutron/lock |
| 702 | |
Victor Ryzhenkin | 878d7d8 | 2016-04-27 15:15:52 +0300 | [diff] [blame] | 703 | # NOTE(freerunner): Need to adjust Region Name for nova in multiregion installation |
| 704 | iniset $NEUTRON_CONF nova region_name $REGION_NAME |
| 705 | |
Joe Gordon | bee5c50 | 2013-08-30 13:48:08 -0400 | [diff] [blame] | 706 | if [ "$VIRT_DRIVER" = 'fake' ]; then |
| 707 | # Disable arbitrary limits |
| 708 | iniset $NEUTRON_CONF quotas quota_network -1 |
| 709 | iniset $NEUTRON_CONF quotas quota_subnet -1 |
| 710 | iniset $NEUTRON_CONF quotas quota_port -1 |
| 711 | iniset $NEUTRON_CONF quotas quota_security_group -1 |
| 712 | iniset $NEUTRON_CONF quotas quota_security_group_rule -1 |
| 713 | fi |
| 714 | |
Salvatore Orlando | 05ae833 | 2013-08-20 14:51:08 -0700 | [diff] [blame] | 715 | # Format logging |
Sean Dague | 9751be6 | 2016-04-05 12:08:57 -0400 | [diff] [blame] | 716 | setup_logging $NEUTRON_CONF |
Salvatore Orlando | 05ae833 | 2013-08-20 14:51:08 -0700 | [diff] [blame] | 717 | |
Rob Crittenden | 18d4778 | 2014-03-19 17:47:42 -0400 | [diff] [blame] | 718 | if is_service_enabled tls-proxy; then |
| 719 | # Set the service port for a proxy to take the original |
| 720 | iniset $NEUTRON_CONF DEFAULT bind_port "$Q_PORT_INT" |
| 721 | fi |
| 722 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 723 | _neutron_setup_rootwrap |
| 724 | } |
| 725 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 726 | function _configure_neutron_dhcp_agent { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 727 | |
Martin Hickey | 30d5fae | 2015-11-10 13:44:15 +0000 | [diff] [blame] | 728 | cp $NEUTRON_DIR/etc/dhcp_agent.ini.sample $Q_DHCP_CONF_FILE |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 729 | |
Ben Nemec | 0399794 | 2013-08-10 09:56:16 -0500 | [diff] [blame] | 730 | iniset $Q_DHCP_CONF_FILE DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL |
Sean Dague | 78801c1 | 2016-08-04 14:10:07 -0400 | [diff] [blame] | 731 | # make it so we have working DNS from guests |
| 732 | iniset $Q_DHCP_CONF_FILE DEFAULT dnsmasq_local_resolv True |
Hirofumi Ichihara | 2bb3a64 | 2015-08-18 12:59:08 -0700 | [diff] [blame] | 733 | iniset $Q_DHCP_CONF_FILE AGENT root_helper "$Q_RR_COMMAND" |
Yuriy Taraday | 2662395 | 2014-07-16 17:41:53 +0400 | [diff] [blame] | 734 | if [[ "$Q_USE_ROOTWRAP_DAEMON" == "True" ]]; then |
Hirofumi Ichihara | 2bb3a64 | 2015-08-18 12:59:08 -0700 | [diff] [blame] | 735 | iniset $Q_DHCP_CONF_FILE AGENT root_helper_daemon "$Q_RR_DAEMON_COMMAND" |
Yuriy Taraday | 2662395 | 2014-07-16 17:41:53 +0400 | [diff] [blame] | 736 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 737 | |
Tan Lin | 27a196e | 2014-10-31 15:44:34 +0800 | [diff] [blame] | 738 | if ! is_service_enabled q-l3; then |
| 739 | if [[ "$ENABLE_ISOLATED_METADATA" = "True" ]]; then |
| 740 | iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata $ENABLE_ISOLATED_METADATA |
| 741 | iniset $Q_DHCP_CONF_FILE DEFAULT enable_metadata_network $ENABLE_METADATA_NETWORK |
| 742 | else |
| 743 | if [[ "$ENABLE_METADATA_NETWORK" = "True" ]]; then |
| 744 | die "$LINENO" "Enable isolated metadata is a must for metadata network" |
| 745 | fi |
| 746 | fi |
| 747 | fi |
| 748 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 749 | _neutron_setup_interface_driver $Q_DHCP_CONF_FILE |
| 750 | |
xurong00037997 | 7ef31d0 | 2016-07-05 11:09:40 +0800 | [diff] [blame] | 751 | neutron_plugin_configure_dhcp_agent $Q_DHCP_CONF_FILE |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 752 | } |
| 753 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 754 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 755 | function _configure_neutron_metadata_agent { |
Martin Hickey | 30d5fae | 2015-11-10 13:44:15 +0000 | [diff] [blame] | 756 | cp $NEUTRON_DIR/etc/metadata_agent.ini.sample $Q_META_CONF_FILE |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 757 | |
Ben Nemec | 0399794 | 2013-08-10 09:56:16 -0500 | [diff] [blame] | 758 | iniset $Q_META_CONF_FILE DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 759 | iniset $Q_META_CONF_FILE DEFAULT nova_metadata_ip $Q_META_DATA_IP |
Armando Migliaccio | 06f2ea2 | 2017-02-02 16:47:00 -0800 | [diff] [blame] | 760 | iniset $Q_META_CONF_FILE DEFAULT metadata_workers $API_WORKERS |
Hirofumi Ichihara | 2bb3a64 | 2015-08-18 12:59:08 -0700 | [diff] [blame] | 761 | iniset $Q_META_CONF_FILE AGENT root_helper "$Q_RR_COMMAND" |
Yuriy Taraday | 2662395 | 2014-07-16 17:41:53 +0400 | [diff] [blame] | 762 | if [[ "$Q_USE_ROOTWRAP_DAEMON" == "True" ]]; then |
Hirofumi Ichihara | 2bb3a64 | 2015-08-18 12:59:08 -0700 | [diff] [blame] | 763 | iniset $Q_META_CONF_FILE AGENT root_helper_daemon "$Q_RR_DAEMON_COMMAND" |
Yuriy Taraday | 2662395 | 2014-07-16 17:41:53 +0400 | [diff] [blame] | 764 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 765 | } |
| 766 | |
Dina Belova | 58adaa6 | 2014-07-11 18:18:12 +0400 | [diff] [blame] | 767 | function _configure_neutron_ceilometer_notifications { |
Matt Riedemann | 45da777 | 2017-03-05 13:07:39 -0500 | [diff] [blame] | 768 | iniset $NEUTRON_CONF oslo_messaging_notifications driver messagingv2 |
Dina Belova | 58adaa6 | 2014-07-11 18:18:12 +0400 | [diff] [blame] | 769 | } |
| 770 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 771 | function _configure_neutron_metering { |
Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame] | 772 | neutron_agent_metering_configure_common |
| 773 | neutron_agent_metering_configure_agent |
| 774 | } |
| 775 | |
Brian Haley | eea7621 | 2014-06-27 11:45:50 -0400 | [diff] [blame] | 776 | function _configure_dvr { |
| 777 | iniset $NEUTRON_CONF DEFAULT router_distributed True |
| 778 | iniset $Q_L3_CONF_FILE DEFAULT agent_mode $Q_DVR_MODE |
| 779 | } |
| 780 | |
| 781 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 782 | # _configure_neutron_plugin_agent() - Set config files for neutron plugin agent |
| 783 | # It is called when q-agt is enabled. |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 784 | function _configure_neutron_plugin_agent { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 785 | # Specify the default root helper prior to agent configuration to |
| 786 | # ensure that an agent's configuration can override the default |
| 787 | iniset /$Q_PLUGIN_CONF_FILE agent root_helper "$Q_RR_COMMAND" |
Yuriy Taraday | 2662395 | 2014-07-16 17:41:53 +0400 | [diff] [blame] | 788 | if [[ "$Q_USE_ROOTWRAP_DAEMON" == "True" ]]; then |
| 789 | iniset /$Q_PLUGIN_CONF_FILE agent root_helper_daemon "$Q_RR_DAEMON_COMMAND" |
| 790 | fi |
Ben Nemec | 0399794 | 2013-08-10 09:56:16 -0500 | [diff] [blame] | 791 | iniset $NEUTRON_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 792 | |
| 793 | # Configure agent for plugin |
| 794 | neutron_plugin_configure_plugin_agent |
| 795 | } |
| 796 | |
| 797 | # _configure_neutron_service() - Set config files for neutron service |
| 798 | # It is called when q-svc is enabled. |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 799 | function _configure_neutron_service { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 800 | Q_API_PASTE_FILE=$NEUTRON_CONF_DIR/api-paste.ini |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 801 | cp $NEUTRON_DIR/etc/api-paste.ini $Q_API_PASTE_FILE |
Kevin Benton | 08a5fcc | 2014-07-18 16:06:12 -0700 | [diff] [blame] | 802 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 803 | # Update either configuration file with plugin |
| 804 | iniset $NEUTRON_CONF DEFAULT core_plugin $Q_PLUGIN_CLASS |
| 805 | |
Ben Nemec | 0399794 | 2013-08-10 09:56:16 -0500 | [diff] [blame] | 806 | iniset $NEUTRON_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL |
Chris Dent | 74a85b0 | 2015-04-22 18:02:39 +0000 | [diff] [blame] | 807 | iniset $NEUTRON_CONF oslo_policy policy_file $Q_POLICY_FILE |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 808 | iniset $NEUTRON_CONF DEFAULT allow_overlapping_ips $Q_ALLOW_OVERLAPPING_IP |
| 809 | |
| 810 | iniset $NEUTRON_CONF DEFAULT auth_strategy $Q_AUTH_STRATEGY |
| 811 | _neutron_setup_keystone $NEUTRON_CONF keystone_authtoken |
| 812 | |
Atsushi SAKAI | fe7b56c | 2015-11-13 17:06:16 +0900 | [diff] [blame] | 813 | # Configuration for neutron notifications to nova. |
Terry Wilson | f06c443 | 2014-05-20 10:54:51 -0500 | [diff] [blame] | 814 | iniset $NEUTRON_CONF DEFAULT notify_nova_on_port_status_changes $Q_NOTIFY_NOVA_PORT_STATUS_CHANGES |
| 815 | iniset $NEUTRON_CONF DEFAULT notify_nova_on_port_data_changes $Q_NOTIFY_NOVA_PORT_DATA_CHANGES |
Jamie Lennox | dc757dd | 2015-03-09 14:48:09 +1100 | [diff] [blame] | 816 | |
Thomas Bechtold | fb94891 | 2016-03-27 08:59:42 +0200 | [diff] [blame] | 817 | configure_auth_token_middleware $NEUTRON_CONF nova $NEUTRON_AUTH_CACHE_DIR nova |
Aaron Rosen | cea32b1 | 2014-03-04 16:20:14 -0800 | [diff] [blame] | 818 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 819 | # Configure plugin |
| 820 | neutron_plugin_configure_service |
| 821 | } |
| 822 | |
| 823 | # Utility Functions |
| 824 | #------------------ |
| 825 | |
Isaku Yamahata | 9e136b4 | 2013-12-16 15:52:03 +0900 | [diff] [blame] | 826 | # _neutron_service_plugin_class_add() - add service plugin class |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 827 | function _neutron_service_plugin_class_add { |
Isaku Yamahata | 9e136b4 | 2013-12-16 15:52:03 +0900 | [diff] [blame] | 828 | local service_plugin_class=$1 |
| 829 | if [[ $Q_SERVICE_PLUGIN_CLASSES == '' ]]; then |
| 830 | Q_SERVICE_PLUGIN_CLASSES=$service_plugin_class |
| 831 | elif [[ ! ,${Q_SERVICE_PLUGIN_CLASSES}, =~ ,${service_plugin_class}, ]]; then |
| 832 | Q_SERVICE_PLUGIN_CLASSES="$Q_SERVICE_PLUGIN_CLASSES,$service_plugin_class" |
| 833 | fi |
| 834 | } |
| 835 | |
Ihar Hrachyshka | f511c36 | 2017-03-07 06:31:49 +0000 | [diff] [blame] | 836 | # _neutron_ml2_extension_driver_add_old() - add ML2 extension driver |
| 837 | function _neutron_ml2_extension_driver_add_old { |
| 838 | local extension=$1 |
| 839 | if [[ $Q_ML2_PLUGIN_EXT_DRIVERS == '' ]]; then |
| 840 | Q_ML2_PLUGIN_EXT_DRIVERS=$extension |
| 841 | elif [[ ! ,${Q_ML2_PLUGIN_EXT_DRIVERS}, =~ ,${extension}, ]]; then |
| 842 | Q_ML2_PLUGIN_EXT_DRIVERS="$Q_ML2_PLUGIN_EXT_DRIVERS,$extension" |
| 843 | fi |
| 844 | } |
| 845 | |
YAMAMOTO Takashi | eede9dd | 2016-07-15 10:27:53 +0900 | [diff] [blame] | 846 | # mutnauq_server_config_add() - add server config file |
| 847 | function mutnauq_server_config_add { |
| 848 | _Q_PLUGIN_EXTRA_CONF_FILES_ABS+=($1) |
| 849 | } |
| 850 | |
Ihar Hrachyshka | 5893cc7 | 2014-12-22 11:49:42 +0100 | [diff] [blame] | 851 | # _neutron_deploy_rootwrap_filters() - deploy rootwrap filters to $Q_CONF_ROOTWRAP_D (owned by root). |
| 852 | function _neutron_deploy_rootwrap_filters { |
gong yong sheng | 3d6eaae | 2015-09-15 15:00:29 +0800 | [diff] [blame] | 853 | if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then |
| 854 | return |
| 855 | fi |
Ihar Hrachyshka | 5893cc7 | 2014-12-22 11:49:42 +0100 | [diff] [blame] | 856 | local srcdir=$1 |
Dean Troyer | 8421c2b | 2015-03-16 13:52:19 -0500 | [diff] [blame] | 857 | sudo install -d -o root -m 755 $Q_CONF_ROOTWRAP_D |
| 858 | sudo install -o root -m 644 $srcdir/etc/neutron/rootwrap.d/* $Q_CONF_ROOTWRAP_D/ |
Ihar Hrachyshka | 5893cc7 | 2014-12-22 11:49:42 +0100 | [diff] [blame] | 859 | } |
| 860 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 861 | # _neutron_setup_rootwrap() - configure Neutron's rootwrap |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 862 | function _neutron_setup_rootwrap { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 863 | if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then |
| 864 | return |
| 865 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 866 | # Wipe any existing ``rootwrap.d`` files first |
| 867 | Q_CONF_ROOTWRAP_D=$NEUTRON_CONF_DIR/rootwrap.d |
| 868 | if [[ -d $Q_CONF_ROOTWRAP_D ]]; then |
| 869 | sudo rm -rf $Q_CONF_ROOTWRAP_D |
| 870 | fi |
Ihar Hrachyshka | 5893cc7 | 2014-12-22 11:49:42 +0100 | [diff] [blame] | 871 | |
| 872 | _neutron_deploy_rootwrap_filters $NEUTRON_DIR |
| 873 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 874 | # Set up ``rootwrap.conf``, pointing to ``$NEUTRON_CONF_DIR/rootwrap.d`` |
| 875 | # location moved in newer versions, prefer new location |
| 876 | if test -r $NEUTRON_DIR/etc/neutron/rootwrap.conf; then |
Dean Troyer | 8421c2b | 2015-03-16 13:52:19 -0500 | [diff] [blame] | 877 | sudo install -o root -g root -m 644 $NEUTRON_DIR/etc/neutron/rootwrap.conf $Q_RR_CONF_FILE |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 878 | else |
Dean Troyer | 8421c2b | 2015-03-16 13:52:19 -0500 | [diff] [blame] | 879 | sudo install -o root -g root -m 644 $NEUTRON_DIR/etc/rootwrap.conf $Q_RR_CONF_FILE |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 880 | fi |
| 881 | sudo sed -e "s:^filters_path=.*$:filters_path=$Q_CONF_ROOTWRAP_D:" -i $Q_RR_CONF_FILE |
Robert Li | 2c5d462 | 2015-04-21 15:48:22 -0400 | [diff] [blame] | 882 | sudo sed -e 's:^exec_dirs=\(.*\)$:exec_dirs=\1,/usr/local/bin:' -i $Q_RR_CONF_FILE |
| 883 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 884 | # Specify ``rootwrap.conf`` as first parameter to neutron-rootwrap |
| 885 | ROOTWRAP_SUDOER_CMD="$NEUTRON_ROOTWRAP $Q_RR_CONF_FILE *" |
Yuriy Taraday | 2662395 | 2014-07-16 17:41:53 +0400 | [diff] [blame] | 886 | ROOTWRAP_DAEMON_SUDOER_CMD="$NEUTRON_ROOTWRAP-daemon $Q_RR_CONF_FILE" |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 887 | |
| 888 | # Set up the rootwrap sudoers for neutron |
| 889 | TEMPFILE=`mktemp` |
Stephan Renatus | e578eff | 2013-11-19 13:31:04 +0100 | [diff] [blame] | 890 | echo "$STACK_USER ALL=(root) NOPASSWD: $ROOTWRAP_SUDOER_CMD" >$TEMPFILE |
Yuriy Taraday | 2662395 | 2014-07-16 17:41:53 +0400 | [diff] [blame] | 891 | echo "$STACK_USER ALL=(root) NOPASSWD: $ROOTWRAP_DAEMON_SUDOER_CMD" >>$TEMPFILE |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 892 | chmod 0440 $TEMPFILE |
| 893 | sudo chown root:root $TEMPFILE |
| 894 | sudo mv $TEMPFILE /etc/sudoers.d/neutron-rootwrap |
| 895 | |
| 896 | # Update the root_helper |
| 897 | iniset $NEUTRON_CONF agent root_helper "$Q_RR_COMMAND" |
Yuriy Taraday | 2662395 | 2014-07-16 17:41:53 +0400 | [diff] [blame] | 898 | if [[ "$Q_USE_ROOTWRAP_DAEMON" == "True" ]]; then |
| 899 | iniset $NEUTRON_CONF agent root_helper_daemon "$Q_RR_DAEMON_COMMAND" |
| 900 | fi |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 901 | } |
| 902 | |
Ihar Hrachyshka | bb4654b | 2015-10-06 18:09:07 +0200 | [diff] [blame] | 903 | # Configures keystone integration for neutron service |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 904 | function _neutron_setup_keystone { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 905 | local conf_file=$1 |
| 906 | local section=$2 |
Jamie Lennox | 3561d7f | 2014-05-21 17:18:43 +1000 | [diff] [blame] | 907 | |
Brant Knudson | 0595237 | 2014-09-19 17:22:22 -0500 | [diff] [blame] | 908 | create_neutron_cache_dir |
| 909 | configure_auth_token_middleware $conf_file $Q_ADMIN_USERNAME $NEUTRON_AUTH_CACHE_DIR $section |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 910 | } |
| 911 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 912 | function _neutron_setup_interface_driver { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 913 | |
| 914 | # ovs_use_veth needs to be set before the plugin configuration |
| 915 | # occurs to allow plugins to override the setting. |
| 916 | iniset $1 DEFAULT ovs_use_veth $Q_OVS_USE_VETH |
| 917 | |
| 918 | neutron_plugin_setup_interface_driver $1 |
| 919 | } |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 920 | # Functions for Neutron Exercises |
| 921 | #-------------------------------- |
| 922 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 923 | function delete_probe { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 924 | local from_net="$1" |
| 925 | net_id=`_get_net_id $from_net` |
| 926 | probe_id=`neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print $2}'` |
| 927 | neutron-debug --os-tenant-name admin --os-username admin probe-delete $probe_id |
| 928 | } |
| 929 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 930 | function _get_net_id { |
Victor Ryzhenkin | 878d7d8 | 2016-04-27 15:15:52 +0300 | [diff] [blame] | 931 | neutron --os-cloud devstack-admin --os-region "$REGION_NAME" --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD net-list | grep $1 | awk '{print $2}' |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 932 | } |
| 933 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 934 | function _get_probe_cmd_prefix { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 935 | local from_net="$1" |
| 936 | net_id=`_get_net_id $from_net` |
| 937 | probe_id=`neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print $2}' | head -n 1` |
| 938 | echo "$Q_RR_COMMAND ip netns exec qprobe-$probe_id" |
| 939 | } |
| 940 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 941 | # ssh check |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 942 | function _ssh_check_neutron { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 943 | local from_net=$1 |
| 944 | local key_file=$2 |
| 945 | local ip=$3 |
| 946 | local user=$4 |
| 947 | local timeout_sec=$5 |
| 948 | local probe_cmd = "" |
| 949 | probe_cmd=`_get_probe_cmd_prefix $from_net` |
Sean Dague | 442e4e9 | 2015-06-24 13:24:02 -0400 | [diff] [blame] | 950 | local testcmd="$probe_cmd ssh -o StrictHostKeyChecking=no -i $key_file ${user}@$ip echo success" |
| 951 | test_with_retry "$testcmd" "server $ip didn't become ssh-able" $timeout_sec |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 952 | } |
| 953 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 954 | # Restore xtrace |
Ian Wienand | 523f488 | 2015-10-13 11:03:03 +1100 | [diff] [blame] | 955 | $_XTRACE_NEUTRON |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 956 | |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 957 | # Tell emacs to use shell-script-mode |
| 958 | ## Local variables: |
| 959 | ## mode: shell-script |
| 960 | ## End: |