Skip to content

Commit

Permalink
fix don't try to cleanup dir before it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan Charbonneau committed Aug 27, 2020
1 parent 8e7b734 commit a116e71
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions nginx/servers_config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,13 @@ nginx_server_available_dir:
{% do valid_sites.append(server) %}
{% endfor %}
{% for filename in salt['file.readdir'](nginx.lookup.server_enabled) %}
{% if filename not in valid_sites %}
{% if salt['file.directory_exists'](nginx.lookup.server_enabled) %}
{% for filename in salt['file.readdir'](nginx.lookup.server_enabled) %}
{% if filename not in valid_sites %}
{{ nginx.lookup.server_enabled ~ '/' ~ filename }}:
file.absent
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}

0 comments on commit a116e71

Please sign in to comment.