Merge pull request #26 from vincentfretin/patch-1

Don't execute a2ensite if the vhost is already enabled
This commit is contained in:
Seth House 2014-08-01 10:56:03 -06:00
commit 2c499ee376
2 changed files with 3 additions and 2 deletions

View File

@ -14,9 +14,9 @@ a2dissite {{ pillar['apache']['register-site'][site]['name'] }}:
{% endif %} {% endif %}
cmd.run: cmd.run:
{% if pillar['apache']['register-site'][site]['state'] == 'enabled' %} {% if pillar['apache']['register-site'][site]['state'] == 'enabled' %}
- unless: ls /etc/apache2/sites-enabled/{{ pillar['apache']['register-site'][site]['name'] }} - unless: test -f /etc/apache2/sites-enabled/{{ pillar['apache']['register-site'][site]['name'] }}
{% else %} {% else %}
- onlyif: ls /etc/apache2/sites-enabled/{{ pillar['apache']['register-site'][site]['name'] }} - onlyif: test -f /etc/apache2/sites-enabled/{{ pillar['apache']['register-site'][site]['name'] }}
{% endif %} {% endif %}
- order: 230 - order: 230
- require: - require:

View File

@ -24,6 +24,7 @@ include:
a2ensite {{ id }}: a2ensite {{ id }}:
cmd: cmd:
- run - run
- unless: test -f /etc/apache2/sites-enabled/{{ id }}
- require: - require:
- file: {{ id }} - file: {{ id }}
- watch_in: - watch_in: