Changed apache2 pillar references to apache

This commit is contained in:
Alan McNea 2013-07-29 21:30:54 +00:00
parent c47ce1b533
commit e90f9ad362
2 changed files with 17 additions and 17 deletions

View File

@ -18,10 +18,10 @@ a2enmod php5:
- watch_in: - watch_in:
- cmd: apache-restart - cmd: apache-restart
{% if 'apache2-php-ini' in pillar %} {% if 'apache-php-ini' in pillar %}
/etc/php5/apache2/php.ini: /etc/php5/apache2/php.ini:
file.managed: file.managed:
- source: {{ pillar['apache2-php-ini'] }} - source: {{ pillar['apache-php-ini'] }}
- order: 225 - order: 225
- watch_in: - watch_in:
- cmd: apache-restart - cmd: apache-restart

View File

@ -1,46 +1,46 @@
{% if 'apache2-register-site' in pillar %} #BEGIN: apache2-register-site {% if 'apache-register-site' in pillar %} #BEGIN: apache-register-site
{% for site in pillar['apache2-register-site'] %} {% for site in pillar['apache-register-site'] %}
#BEGIN: Call apache a2ensite #BEGIN: Call apache a2ensite
########################################## ##########################################
{% if 'name' in pillar['apache2-register-site'][site] and 'state' in pillar['apache2-register-site'][site] %} {% if 'name' in pillar['apache-register-site'][site] and 'state' in pillar['apache-register-site'][site] %}
{% if pillar['apache2-register-site'][site]['state'] == 'enabled' %} {% if pillar['apache-register-site'][site]['state'] == 'enabled' %}
a2ensite {{ pillar['apache2-register-site'][site]['name'] }}: a2ensite {{ pillar['apache-register-site'][site]['name'] }}:
{% else %} {% else %}
a2dissite {{ pillar['apache2-register-site'][site]['name'] }}: a2dissite {{ pillar['apache-register-site'][site]['name'] }}:
{% endif %} {% endif %}
cmd.run: cmd.run:
{% if pillar['apache2-register-site'][site]['state'] == 'enabled' %} {% if pillar['apache-register-site'][site]['state'] == 'enabled' %}
- unless: ls /etc/apache2/sites-enabled/{{ pillar['apache2-register-site'][site]['name'] }} - unless: ls /etc/apache2/sites-enabled/{{ pillar['apache-register-site'][site]['name'] }}
{% else %} {% else %}
- onlyif: ls /etc/apache2/sites-enabled/{{ pillar['apache2-register-site'][site]['name'] }} - onlyif: ls /etc/apache2/sites-enabled/{{ pillar['apache-register-site'][site]['name'] }}
{% endif %} {% endif %}
- order: 230 - order: 230
- require: - require:
- pkg: apache - pkg: apache
- file: /etc/apache2/sites-available/{{ pillar['apache2-register-site'][site]['name'] }} - file: /etc/apache2/sites-available/{{ pillar['apache-register-site'][site]['name'] }}
{% endif %} {% endif %}
########################################## ##########################################
#BEGIN: Manage apache site config #BEGIN: Manage apache site config
########################################## ##########################################
{% if 'name' in pillar['apache2-register-site'][site] and 'path' in pillar['apache2-register-site'][site] %} {% if 'name' in pillar['apache-register-site'][site] and 'path' in pillar['apache-register-site'][site] %}
/etc/apache2/sites-available/{{ pillar['apache2-register-site'][site]['name'] }}: /etc/apache2/sites-available/{{ pillar['apache-register-site'][site]['name'] }}:
file.managed: file.managed:
- source: {{ pillar['apache2-register-site'][site]['path'] }} - source: {{ pillar['apache-register-site'][site]['path'] }}
- order: 225 - order: 225
- user: root - user: root
- group: root - group: root
- mode: 775 - mode: 775
- watch_in: - watch_in:
- cmd: a2ensite {{ pillar['apache2-register-site'][site]['name'] }} - cmd: a2ensite {{ pillar['apache-register-site'][site]['name'] }}
- cmd: apache-reload - cmd: apache-reload
{% endif %} {% endif %}
########################################## ##########################################
{% endfor %} {% endfor %}
{% endif %} #END: apache2-register-site {% endif %} #END: apache-register-site