mirror of
https://github.com/saltstack-formulas/apache-formula.git
synced 2025-04-17 10:10:26 +00:00
fix(vhosts/cleanup): check sites-enabled
dir exists before listing it
Co-authored-by: Tristan Charbonneau <tcharbonneau@oceanet-technology.com> Fix #278
This commit is contained in:
parent
7dacabcd67
commit
88373e38f5
1 changed files with 6 additions and 4 deletions
|
@ -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…
Add table
Reference in a new issue