Merge "Add Salt 2018.3 tests"
diff --git a/README.rst b/README.rst
index d51c7b5..34d660e 100644
--- a/README.rst
+++ b/README.rst
@@ -211,6 +211,7 @@
         version: mitaka
         dhcp_lease_duration: 600
         firewall_driver: iptables_hybrid
+        ovs_use_veth: False
         message_queue:
           engine: rabbitmq
           host: 127.0.0.1
@@ -922,6 +923,7 @@
         user: admin
         password: admin
         ovsdb_connection: tcp:127.0.0.1:6639
+        ovsdb_interface: native
         enable_websocket: true
         enable_dhcp_service: false
         mechanism:
@@ -938,6 +940,7 @@
       backend:
         router: odl-router_v2
         ovsdb_connection: tcp:127.0.0.1:6639
+        ovsdb_interface: native
       opendaylight:
         ovsdb_server_iface: ptcp:6639:127.0.0.1
         ovsdb_odl_iface: tcp:10.20.0.77:6640
diff --git a/neutron/compute.sls b/neutron/compute.sls
index 933680f..b7d802c 100644
--- a/neutron/compute.sls
+++ b/neutron/compute.sls
@@ -88,19 +88,17 @@
 - neutron.fwaas
 {%- endif %}
 
-{%- if not grains.get('noservices', False) %}
+{%- if not grains.get('noservices', False) and pillar.haproxy is not defined %}
 # NOTE(mpolenchuk): haproxy is used as a replacement for
 # neutron-ns-metadata-proxy Python implementation starting from Pike
 haproxy:
-  {%- if grains['saltversioninfo'] < [2017,7] %}
-  module.run:
-  - name: service.mask
-  - m_name: haproxy
-  {%- else %}
-  service.masked:
-  {%- endif %}
-  - prereq:
+  service.dead:
+  - enable: False
+  - require:
     - pkg: neutron_dvr_packages
+{%- if compute.get('dhcp_agent_enabled', False) %}
+    - pkg: neutron_dhcp_agent_packages
+{%- endif %}
 {%- endif %}
 
 neutron_dvr_packages:
diff --git a/neutron/files/pike/dhcp_agent.ini b/neutron/files/pike/dhcp_agent.ini
index 0b2c60f..437d3d1 100644
--- a/neutron/files/pike/dhcp_agent.ini
+++ b/neutron/files/pike/dhcp_agent.ini
@@ -15,6 +15,9 @@
 # Uses veth for an OVS interface or not. Support kernels with limited namespace support (e.g. RHEL 6.5) so long as ovs_use_veth is set to
 # True. (boolean value)
 #ovs_use_veth = false
+{%- if neutron.ovs_use_veth is defined %}
+ovs_use_veth = {{ neutron.ovs_use_veth }}
+{%- endif %}
 
 # MTU setting for device. This option will be removed in Newton. Please use the system-wide global_physnet_mtu setting which the agents will
 # take into account when wiring VIFs. (integer value)
diff --git a/neutron/files/pike/l3_agent.ini b/neutron/files/pike/l3_agent.ini
index 7b386a5..85ca1a9 100644
--- a/neutron/files/pike/l3_agent.ini
+++ b/neutron/files/pike/l3_agent.ini
@@ -18,6 +18,9 @@
 # support (e.g. RHEL 6.5) so long as ovs_use_veth is set to True. (boolean
 # value)
 #ovs_use_veth = false
+{%- if neutron.ovs_use_veth is defined %}
+ovs_use_veth = {{ neutron.ovs_use_veth }}
+{%- endif %}
 
 # The driver used to manage the virtual interface. (string value)
 #interface_driver = <None>
diff --git a/neutron/files/pike/neutron-generic.conf.Debian b/neutron/files/pike/neutron-generic.conf.Debian
index fe9feae..57cedea 100644
--- a/neutron/files/pike/neutron-generic.conf.Debian
+++ b/neutron/files/pike/neutron-generic.conf.Debian
@@ -2096,7 +2096,10 @@
 # cipher list format. (string value)
 #ciphers = <None>
 
-{%- if neutron.backend.ovsdb_connection is defined %}
 [ovs]
+{%- if neutron.backend.ovsdb_interface is defined %}
+ovsdb_interface = {{ neutron.backend.ovsdb_interface }}
+{%- endif %}
+{%- if neutron.backend.ovsdb_connection is defined %}
 ovsdb_connection = {{ neutron.backend.ovsdb_connection }}
 {%- endif %}
diff --git a/neutron/files/pike/neutron-server.conf.Debian b/neutron/files/pike/neutron-server.conf.Debian
index 63e377b..7118277 100644
--- a/neutron/files/pike/neutron-server.conf.Debian
+++ b/neutron/files/pike/neutron-server.conf.Debian
@@ -2277,7 +2277,10 @@
 auth_url=http://{{ server.identity.host }}:35357
 {%- endif %}
 
-{%- if server.backend.ovsdb_connection is defined %}
 [ovs]
+{%- if server.backend.ovsdb_interface is defined %}
+ovsdb_interface = {{ server.backend.ovsdb_interface }}
+{%- endif %}
+{%- if server.backend.ovsdb_connection is defined %}
 ovsdb_connection = {{ server.backend.ovsdb_connection }}
 {%- endif %}
diff --git a/neutron/files/queens/dhcp_agent.ini b/neutron/files/queens/dhcp_agent.ini
index ec530ed..b16e956 100644
--- a/neutron/files/queens/dhcp_agent.ini
+++ b/neutron/files/queens/dhcp_agent.ini
@@ -16,6 +16,9 @@
 # support (e.g. RHEL 6.5) and rate limiting on router's gateway port so long as
 # ovs_use_veth is set to True. (boolean value)
 #ovs_use_veth = false
+{%- if neutron.ovs_use_veth is defined %}
+ovs_use_veth = {{ neutron.ovs_use_veth }}
+{%- endif %}
 
 # The driver used to manage the virtual interface. (string value)
 #interface_driver = <None>
diff --git a/neutron/files/queens/l3_agent.ini b/neutron/files/queens/l3_agent.ini
index 69e97be..b3fcdfa 100644
--- a/neutron/files/queens/l3_agent.ini
+++ b/neutron/files/queens/l3_agent.ini
@@ -18,6 +18,9 @@
 # support (e.g. RHEL 6.5) and rate limiting on router's gateway port so long as
 # ovs_use_veth is set to True. (boolean value)
 #ovs_use_veth = false
+{%- if neutron.ovs_use_veth is defined %}
+ovs_use_veth = {{ neutron.ovs_use_veth }}
+{%- endif %}
 
 # The driver used to manage the virtual interface. (string value)
 #interface_driver = <None>
diff --git a/neutron/files/queens/neutron-generic.conf.Debian b/neutron/files/queens/neutron-generic.conf.Debian
index 9c985a5..9b8c819 100644
--- a/neutron/files/queens/neutron-generic.conf.Debian
+++ b/neutron/files/queens/neutron-generic.conf.Debian
@@ -501,7 +501,10 @@
 [ssl]
 {%- include "oslo_templates/files/queens/oslo/service/_ssl.conf" %}
 
-{%- if neutron.backend.ovsdb_connection is defined %}
 [ovs]
+{%- if neutron.backend.ovsdb_interface is defined %}
+ovsdb_interface = {{ neutron.backend.ovsdb_interface }}
+{%- endif %}
+{%- if neutron.backend.ovsdb_connection is defined %}
 ovsdb_connection = {{ neutron.backend.ovsdb_connection }}
 {%- endif %}
diff --git a/neutron/files/queens/neutron-server.conf.Debian b/neutron/files/queens/neutron-server.conf.Debian
index e68d3a9..bf4cddc 100644
--- a/neutron/files/queens/neutron-server.conf.Debian
+++ b/neutron/files/queens/neutron-server.conf.Debian
@@ -533,8 +533,11 @@
 [ssl]
 {%- include "oslo_templates/files/queens/oslo/service/_ssl.conf" %}
 
-{%- if server.backend.ovsdb_connection is defined %}
 [ovs]
+{%- if server.backend.ovsdb_interface is defined %}
+ovsdb_interface = {{ server.backend.ovsdb_interface }}
+{%- endif %}
+{%- if server.backend.ovsdb_connection is defined %}
 ovsdb_connection = {{ server.backend.ovsdb_connection }}
 {%- endif %}
 
diff --git a/tests/pillar/control_opendaylight.sls b/tests/pillar/control_opendaylight.sls
index 9064406..76a4c90 100644
--- a/tests/pillar/control_opendaylight.sls
+++ b/tests/pillar/control_opendaylight.sls
@@ -56,6 +56,7 @@
       user: admin
       password: admin
       ovsdb_connection: tcp:127.0.0.1:6639
+      ovsdb_interface: native
       mechanism:
         ovs:
           driver: opendaylight
diff --git a/tests/pillar/gateway_legacy.sls b/tests/pillar/gateway_legacy.sls
index c67c80b..c2606f3 100644
--- a/tests/pillar/gateway_legacy.sls
+++ b/tests/pillar/gateway_legacy.sls
@@ -3,6 +3,7 @@
     agent_mode: legacy
     dhcp_lease_duration: 86400
     firewall_driver: noop
+    ovs_use_veth: True
     backend:
       engine: ml2
       tenant_network_types: "flat,vxlan"
diff --git a/tests/pillar/gateway_legacy_opendaylight.sls b/tests/pillar/gateway_legacy_opendaylight.sls
index 8bf6b26..2f43676 100644
--- a/tests/pillar/gateway_legacy_opendaylight.sls
+++ b/tests/pillar/gateway_legacy_opendaylight.sls
@@ -6,6 +6,7 @@
       tenant_network_types: "flat,vxlan"
       router: odl-router
       ovsdb_connection: tcp:127.0.0.1:6639
+      ovsdb_interface: native
       mechanism:
         ovs:
           driver: opendaylight