Add running state for services inside containers
PROD-16646
Change-Id: I563b5b2ef7cdcac39eb3ea74501134ad92cbeafc
diff --git a/opencontrail/collector.sls b/opencontrail/collector.sls
index 46cdf9b..34169ec 100644
--- a/opencontrail/collector.sls
+++ b/opencontrail/collector.sls
@@ -127,6 +127,22 @@
{%- endif %}
+{%- else %}
+{%- if collector.container_name is defined %}
+opencontrail_collector_dockerng_services:
+ dockerng_service.running:
+ - services: {{ collector.services }}
+ - container: {{ collector.container_name }}
+ - watch:
+ - file: /etc/contrail/contrail-analytics-api.conf
+ - file: /etc/contrail/contrail-query-engine.conf
+ - file: /etc/contrail/contrail-collector.conf
+ - file: {{ collector.redis_config }}
+ - file: /etc/contrail/contrail-topology.conf
+ - file: /etc/contrail/contrail-snmp-collector.conf
+ - file: /etc/contrail/contrail-analytics-nodemgr.conf
+ - file: /etc/contrail/contrail-alarm-gen.conf
+{%- endif%}
{%- endif %}
{%- endif %}
diff --git a/opencontrail/config.sls b/opencontrail/config.sls
index 1d659f1..67d1c5a 100644
--- a/opencontrail/config.sls
+++ b/opencontrail/config.sls
@@ -226,6 +226,24 @@
{%- endif %}
+{%- else %}
+{%- if config.container_name is defined %}
+opencontrail_config_dockerng_services:
+ dockerng_service.running:
+ - services: {{ config.services }}
+ - container: {{ config.container_name }}
+ - watch:
+ - file: /etc/contrail/contrail-svc-monitor.conf
+ - file: /etc/contrail/contrail-schema.conf
+ - file: /etc/contrail/contrail-api.conf
+ - file: /etc/contrail/vnc_api_lib.ini
+ - file: /etc/contrail/contrail-device-manager.conf
+ - file: /etc/contrail/contrail-config-nodemgr.conf
+ {%- if config.identity.engine == "keystone" %}
+ - file: /etc/contrail/contrail-keystone-auth.conf
+ {%- endif %}
+{%- endif%}
+
{%- endif %}
{%- endif %}
diff --git a/opencontrail/control.sls b/opencontrail/control.sls
index ea00f9b..2300968 100644
--- a/opencontrail/control.sls
+++ b/opencontrail/control.sls
@@ -116,6 +116,18 @@
- mode: 755
{%- endif %}
+{%- else %}
+{%- if control.container_name is defined %}
+opencontrail_control_dockerng_services:
+ dockerng_service.running:
+ - services: {{ control.services }}
+ - container: {{ control.container_name }}
+ - watch:
+ - file: /etc/contrail/dns/contrail-rndc.conf
+ - file: /etc/contrail/contrail-dns.conf
+ - file: /etc/contrail/contrail-control.conf
+ - file: /etc/contrail/contrail-control-nodemgr.conf
+{%- endif %}
{%- endif %}
{%- endif %}
diff --git a/opencontrail/database.sls b/opencontrail/database.sls
index 2edfff5..e7a411f 100644
--- a/opencontrail/database.sls
+++ b/opencontrail/database.sls
@@ -276,6 +276,28 @@
{%- endif %}
+{%- else %}
+{%- if database.container_name is defined %}
+opencontrail_database_dockerng_services:
+ dockerng_service.running:
+ - services:
+ - contrail-database
+ - kafka
+ - contrail-database-nodemgr
+ - zookeeper
+ - container: {{ database.container_name }}
+ - watch:
+ - file: {{ database.cassandra_config }}cassandra.yaml
+ - file: {{ database.cassandra_config }}cassandra-env.sh
+ - file: {{ database.cassandra_config }}logback.xml
+ - file: /etc/zookeeper/conf/zoo.cfg
+ - file: /etc/default/zookeeper
+ - file: /etc/contrail/contrail-database-nodemgr.conf
+ - file: /var/lib/zookeeper/myid
+ - file: /etc/zookeeper/conf/log4j.properties
+ - file: /usr/share/kafka/config/server.properties
+{%- endif %}
+
{%- endif %}
{%- endif %}
diff --git a/opencontrail/map.jinja b/opencontrail/map.jinja
index c3edaef..41c9b81 100644
--- a/opencontrail/map.jinja
+++ b/opencontrail/map.jinja
@@ -25,6 +25,10 @@
{%- else %}
['contrail-collector', 'contrail-analytics-api', 'contrail-query-engine', 'contrail-alarm-gen', 'contrail-snmp-collector', 'contrail-topology', 'contrail-analytics-nodemgr', 'redis-server']
{%- endif %}
+ {%- if pillar.get('docker', {}).get('client', {}).get('compose', {}).get('opencontrail', {}).get('service', {}).get('analytics', {}).container_name is defined %}
+ container_name:
+ {{ pillar.docker.client.compose.opencontrail.service.analytics.container_name }}
+ {%- endif%}
RedHat:
pkgs:
['contrail-analytics']
@@ -35,6 +39,10 @@
{%- else %}
['contrail-collector', 'contrail-analytics-api', 'contrail-query-engine', 'contrail-alarm-gen', 'contrail-snmp-collector', 'contrail-topology', 'contrail-analytics-nodemgr', 'redis']
{%- endif %}
+ {%- if pillar.get('docker', {}).get('client', {}).get('compose', {}).get('opencontrail', {}).get('service', {}).get('analytics', {}).container_name is defined %}
+ container_name:
+ {{ pillar.docker.client.compose.opencontrail.service.analytics.container_name }}
+ {%- endif%}
compute:
Debian:
pkgs:
@@ -68,6 +76,10 @@
{%- else %}
['contrail-api', 'contrail-schema', 'contrail-svc-monitor', 'contrail-device-manager', 'contrail-config-nodemgr']
{%- endif %}
+ {%- if pillar.get('docker', {}).get('client', {}).get('compose', {}).get('opencontrail', {}).get('service', {}).get('controller', {}).container_name is defined %}
+ container_name:
+ {{ pillar.docker.client.compose.opencontrail.service.controller.container_name }}
+ {%- endif%}
RedHat:
pkgs:
['contrail-openstack-config']
@@ -77,6 +89,10 @@
{%- else %}
['contrail-api', 'contrail-schema', 'contrail-svc-monitor', 'contrail-device-manager', 'contrail-config-nodemgr']
{%- endif %}
+ {%- if pillar.get('docker', {}).get('client', {}).get('compose', {}).get('opencontrail', {}).get('service', {}).get('controller', {}).container_name is defined %}
+ container_name:
+ {{ pillar.docker.client.compose.opencontrail.service.controller.container_name }}
+ {%- endif%}
control:
Debian:
pkgs:
@@ -87,6 +103,10 @@
{%- else %}
['contrail-control', 'contrail-named', 'contrail-dns', 'contrail-control-nodemgr']
{%- endif %}
+ {%- if pillar.get('docker', {}).get('client', {}).get('compose', {}).get('opencontrail', {}).get('service', {}).get('controller', {}).container_name is defined %}
+ container_name:
+ {{ pillar.docker.client.compose.opencontrail.service.controller.container_name }}
+ {%- endif%}
RedHat:
pkgs:
['contrail-openstack-control']
@@ -96,6 +116,10 @@
{%- else %}
['contrail-control', 'contrail-named', 'contrail-dns', 'contrail-control-nodemgr']
{%- endif %}
+ {%- if pillar.get('docker', {}).get('client', {}).get('compose', {}).get('opencontrail', {}).get('service', {}).get('controller', {}).container_name is defined %}
+ container_name:
+ {{ pillar.docker.client.compose.opencontrail.service.controller.container_name }}
+ {%- endif%}
database:
Debian:
pkgs:
@@ -110,6 +134,10 @@
{%- else %}
['contrail-database', 'contrail-database-nodemgr', 'zookeeper']
{%- endif %}
+ {%- if pillar.get('docker', {}).get('client', {}).get('compose', {}).get('opencontrail', {}).get('service', {}).get('analyticsdb', {}).container_name is defined %}
+ container_name:
+ {{ pillar.docker.client.compose.opencontrail.service.analyticsdb.container_name }}
+ {%- endif%}
RedHat:
pkgs:
['contrail-openstack-database', 'zookeeper', 'supervisor', 'java-1.7.0-openjdk-headless']
@@ -121,6 +149,10 @@
{%- else %}
['contrail-database', 'contrail-database-nodemgr', 'zookeeper']
{%- endif %}
+ {%- if pillar.get('docker', {}).get('client', {}).get('compose', {}).get('opencontrail', {}).get('service', {}).get('analyticsdb', {}).container_name is defined %}
+ container_name:
+ {{ pillar.docker.client.compose.opencontrail.service.analyticsdb.container_name }}
+ {%- endif%}
web:
Debian:
pkgs:
@@ -130,6 +162,10 @@
database:
engine: cassandra
port: 9160
+ {%- if pillar.get('docker', {}).get('client', {}).get('compose', {}).get('opencontrail', {}).get('service', {}).get('controller', {}).container_name is defined %}
+ container_name:
+ {{ pillar.docker.client.compose.opencontrail.service.controller.container_name }}
+ {%- endif%}
RedHat:
pkgs:
['contrail-web-controller']
@@ -138,6 +174,10 @@
database:
engine: cassandra
port: 9160
+ {%- if pillar.get('docker', {}).get('client', {}).get('compose', {}).get('opencontrail', {}).get('service', {}).get('controller', {}).container_name is defined %}
+ container_name:
+ {{ pillar.docker.client.compose.opencontrail.service.controller.container_name }}
+ {%- endif%}
client:
Debian:
pkgs:
@@ -276,6 +316,10 @@
database:
engine: cassandra
port: 9160
+ {%- if pillar.docker.client.compose.opencontrail_api.service.controller.name is defined %}
+ container_name:
+ {{ pillar.docker.client.compose.opencontrail_api.service.controller.name }}
+ {%- endif%}
RedHat:
pkgs:
['contrail-web-controller']
@@ -284,6 +328,10 @@
database:
engine: cassandra
port: 9160
+ {%- if pillar.docker.client.compose.opencontrail_api.service.controller.name is defined %}
+ container_name:
+ {{ pillar.docker.client.compose.opencontrail_api.service.controller.name }}
+ {%- endif%}
client:
Debian:
pkgs:
diff --git a/opencontrail/web.sls b/opencontrail/web.sls
index 8e6273b..e31db89 100644
--- a/opencontrail/web.sls
+++ b/opencontrail/web.sls
@@ -57,6 +57,19 @@
file.managed:
- source: salt://opencontrail/files/{{ web.version }}/contrail-webui-webserver.service
- template: jinja
+
+{%- if web.container_name is defined %}
+opencontrail_web_dockerng_services:
+ dockerng_service.running:
+ - services:
+ - contrail-webui-middleware
+ - contrail-webui
+ - container: {{ web.container_name }}
+ - watch:
+ - file: /etc/contrail/config.global.js
+ - file: /etc/contrail/contrail-webui-userauth.js
+{%- endif%}
+
{%- endif %}
{%- endif %}