Browse Source

fix(vhosts/cleanup): check `sites-enabled` dir exists before listing it

Co-authored-by: Tristan Charbonneau <tcharbonneau@oceanet-technology.com>

Fix #278
tags/v0.39.5
Yoda-BZH 4 years ago
parent
commit
88373e38f5
No account linked to committer's email address
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      apache/vhosts/cleanup.sls

+ 6
- 4
apache/vhosts/cleanup.sls View File

@@ -21,8 +21,9 @@ include:
{% endfor %}


{% for filename in salt['file.readdir']('/etc/apache2/sites-enabled/') %}
{% if filename not in valid_sites %}
{% if salt['file.directory_exists'](dirpath) %}
{% for filename in salt['file.readdir'](dirpath) %}
{% if filename not in valid_sites %}

a2dissite {{ filename }}:
cmd.run:
@@ -34,8 +35,9 @@ a2dissite {{ filename }}:
- module: apache-reload
- service: apache

{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}


{% endif %}{# Debian #}

Loading…
Cancel
Save