Fix include conflicts
Employ jinja include statements instead of native salt ones
to be able to activate multiple services/features at once.
Change-Id: I49b3b15fadf1aca5d2c369bb0b055b4271c4f779
Closes-Bug: PROD-20132
diff --git a/neutron/agents/l2gw.sls b/neutron/agents/_l2gw.sls
similarity index 100%
rename from neutron/agents/l2gw.sls
rename to neutron/agents/_l2gw.sls
diff --git a/neutron/compute.sls b/neutron/compute.sls
index e83a5b7..0dc1344 100644
--- a/neutron/compute.sls
+++ b/neutron/compute.sls
@@ -29,16 +29,14 @@
{% endif %}
{%- if compute.opendaylight is defined %}
-include:
- - .opendaylight.client
+{%- include "neutron/opendaylight/client.sls" %}
{%- else %}
neutron_compute_packages:
pkg.installed:
- names: {{ compute.pkgs }}
{% if compute.get('bgp_vpn', {}).get('enabled', False) and compute.bgp_vpn.driver == "bagpipe" %}
-include:
- - .services._bagpipe
+{%- include "neutron/services/_bagpipe.sls" %}
{% endif %}
/etc/neutron/neutron.conf:
diff --git a/neutron/gateway.sls b/neutron/gateway.sls
index ddcea6c..9c884ce 100644
--- a/neutron/gateway.sls
+++ b/neutron/gateway.sls
@@ -5,11 +5,6 @@
- neutron.fwaas
{%- endif %}
-{%- if gateway.l2gw is defined %}
-include:
- - .agents.l2gw
-{%- endif %}
-
{%- if gateway.enabled %}
neutron_gateway_packages:
pkg.installed:
@@ -26,7 +21,13 @@
{%- endif %}
+{%- if gateway.l2gw is defined %}
+{%- include "neutron/agents/_l2gw.sls" %}
+{%- endif %}
+{%- if gateway.opendaylight is defined %}
+{%- include "neutron/opendaylight/client.sls" %}
+{%- else %}
/etc/neutron/l3_agent.ini:
file.managed:
- source: salt://neutron/files/{{ gateway.version }}/l3_agent.ini
@@ -34,6 +35,14 @@
- require:
- pkg: neutron_gateway_packages
+/etc/neutron/plugins/ml2/openvswitch_agent.ini:
+ file.managed:
+ - source: salt://neutron/files/{{ gateway.version }}/openvswitch_agent.ini
+ - template: jinja
+ - require:
+ - pkg: neutron_gateway_packages
+{%- endif %}
+
/etc/neutron/dhcp_agent.ini:
file.managed:
- source: salt://neutron/files/{{ gateway.version }}/dhcp_agent.ini
@@ -48,13 +57,6 @@
- require:
- pkg: neutron_gateway_packages
-/etc/neutron/plugins/ml2/openvswitch_agent.ini:
- file.managed:
- - source: salt://neutron/files/{{ gateway.version }}/openvswitch_agent.ini
- - template: jinja
- - require:
- - pkg: neutron_gateway_packages
-
{%- for service_name in gateway.services %}
{{ service_name }}_default:
file.managed:
@@ -107,10 +109,12 @@
- enable: true
- watch:
- file: /etc/neutron/neutron.conf
- - file: /etc/neutron/l3_agent.ini
- file: /etc/neutron/metadata_agent.ini
- - file: /etc/neutron/plugins/ml2/openvswitch_agent.ini
- file: /etc/neutron/dhcp_agent.ini
+ {%- if gateway.opendaylight is not defined %}
+ - file: /etc/neutron/l3_agent.ini
+ - file: /etc/neutron/plugins/ml2/openvswitch_agent.ini
+ {%- endif %}
{%- if fwaas.get('enabled', False) %}
- file: /etc/neutron/fwaas_driver.ini
{%- endif %}
@@ -133,9 +137,4 @@
{%- endif %}
{%- endif %}
-{%- if gateway.opendaylight is defined %}
-include:
- - .opendaylight.client
-{%- endif %}
-
{%- endif %}
diff --git a/neutron/server.sls b/neutron/server.sls
index 7c13131..21171bb 100644
--- a/neutron/server.sls
+++ b/neutron/server.sls
@@ -112,8 +112,7 @@
{%- endif %}
{%- if server.l2gw is defined %}
-include:
- - .services.l2gw
+{%- include "neutron/services/_l2gw.sls" %}
{%- endif %}
{%- if server.backend.get('opendaylight', False) %}
diff --git a/neutron/services/l2gw.sls b/neutron/services/_l2gw.sls
similarity index 90%
rename from neutron/services/l2gw.sls
rename to neutron/services/_l2gw.sls
index c350ec1..f91b83e 100644
--- a/neutron/services/l2gw.sls
+++ b/neutron/services/_l2gw.sls
@@ -9,6 +9,8 @@
file.managed:
- source: salt://neutron/files/{{ server.version }}/l2gw/l2gw_plugin.ini
- template: jinja
+ - require_in:
+ - cmd: neutron_db_manage
- require:
- pkg: networking_l2gw_packages
- watch_in: