[states/uwsgi] extract service.running in a dedicated sls file
authorDavid Douard <david.douard@logilab.fr>
Wed, 05 Apr 2017 09:22:16 +0200
changeset 125 de1d190ec0f2
parent 124 ba70cd5e5af6
child 126 dc6cc57a778b
[states/uwsgi] extract service.running in a dedicated sls file so that it can be excluded from a deployment
cubicweb/pyramid/init.sls
cubicweb/uwsgi/init.sls
cubicweb/uwsgi/service.sls
cubicweb/uwsgi/uwsgi.ini
--- a/cubicweb/pyramid/init.sls	Tue Mar 14 17:36:38 2017 +0100
+++ b/cubicweb/pyramid/init.sls	Wed Apr 05 09:22:16 2017 +0200
@@ -12,9 +12,5 @@
     - context:
         config: {{ config }}
         name: {{ name }}
-    {% if 'cwapp_uwsgi_options' in config.keys() %}
-    - watch_in:
-        - service: uwsgi
-    {% endif %}
   {% endfor %}
 {% endfor %}
--- a/cubicweb/uwsgi/init.sls	Tue Mar 14 17:36:38 2017 +0100
+++ b/cubicweb/uwsgi/init.sls	Wed Apr 05 09:22:16 2017 +0200
@@ -8,10 +8,6 @@
       - uwsgi
       - uwsgi-plugin-python
 
-service uwsgi running:
-  service.running:
-    - name: uwsgi
-
 
 {% for vhostname, vhost in pillar['cubicweb_apps'].iteritems() %}
  {% for name, config in vhost.iteritems() %}
@@ -34,10 +30,8 @@
       - cubicweb_instance: cw-{{vhostname}}-{{name}}
       - file: /etc/uwsgi/apps-available/{{ name }}.ini
   {% else %}
-  file.absent:
+  file.absent
   {% endif %}
-    - watch_in:
-      - service: uwsgi
 {% endif %}
 
 {% if 'file' in  config['cwapp_uwsgi_options'].keys() %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cubicweb/uwsgi/service.sls	Wed Apr 05 09:22:16 2017 +0200
@@ -0,0 +1,6 @@
+include:
+  - cubicweb.uwsgi
+
+service uwsgi running:
+  service.running:
+    - name: uwsgi
--- a/cubicweb/uwsgi/uwsgi.ini	Tue Mar 14 17:36:38 2017 +0100
+++ b/cubicweb/uwsgi/uwsgi.ini	Wed Apr 05 09:22:16 2017 +0200
@@ -2,7 +2,7 @@
 master = true
 http = 0.0.0.0:{{ config.cwapp.port|default('8080', true) }}
 env = CW_INSTANCE={{ name }}
-#env = CW_DEBUG=1
+env = CW_DEBUG=1
 env = PYTHONPATH=/usr/share/cubicweb
 {% if 'file' in  config.cwapp_uwsgi_options.keys() and config.cwapp_uwsgi_options.file %}
 wsgi-file = {{ config.cwapp_uwsgi_options.file }}