[cubiweb/uwsgi] disable uwsgi app when enable=False
authorArthur Lutz <arthur.lutz@logilab.fr>
Wed, 22 Feb 2017 11:23:53 +0100
changeset 121 028f9fbae8ea
parent 120 7cb4b242d8f5
child 122 d8ced0682c44
[cubiweb/uwsgi] disable uwsgi app when enable=False
cubicweb/uwsgi/init.sls
--- a/cubicweb/uwsgi/init.sls	Wed Feb 22 10:33:27 2017 +0100
+++ b/cubicweb/uwsgi/init.sls	Wed Feb 22 11:23:53 2017 +0100
@@ -26,16 +26,18 @@
       - pkg: uwsgi install
 
 {% if 'enabled' in config['cwapp_uwsgi_options'].keys() %}
+/etc/uwsgi/apps-enabled/{{ name }}.ini:
  {% if config['cwapp_uwsgi_options']['enabled'] %}
-/etc/uwsgi/apps-enabled/{{ name }}.ini:
   file.symlink:
     - target: /etc/uwsgi/apps-available/{{ name }}.ini
     - require:
       - cubicweb_instance: cw-{{vhostname}}-{{name}}
       - file: /etc/uwsgi/apps-available/{{ name }}.ini
+  {% else %}
+  file.absent:
+  {% endif %}
     - watch_in:
       - service: uwsgi
-  {% endif %}
 {% endif %}
 
 {% if 'file' in  config['cwapp_uwsgi_options'].keys() %}