Browse Source

Merge pull request #10 from PCMi/master

Bug fixes and upgrades
tags/v0.37.4
Joseph Hall 11 years ago
parent
commit
4c7b7233da
7 changed files with 47 additions and 10 deletions
  1. +4
    -6
      apache/debian_full.sls
  2. +9
    -0
      apache/init.sls
  3. +1
    -0
      apache/php5.sls
  4. +3
    -0
      apache/rewrite.sls
  5. +16
    -0
      apache/vhost_alias.sls
  6. +3
    -1
      apache/vhosts/standard.sls
  7. +11
    -3
      apache/vhosts/standard.tmpl

+ 4
- 6
apache/debian_full.sls View File

- require: - require:
- pkg: apache - pkg: apache


apache-reload:
cmd.wait:
- name: service apache2 reload
extend:
apache-reload:
- order: 420 - order: 420


apache-restart:
cmd.wait:
- name: service apache2 restart
extend:
apache-restart:
- order: 425 - order: 425


/etc/apache2/sites-available/default: /etc/apache2/sites-available/default:

+ 9
- 0
apache/init.sls View File

- running - running
- name: {{ apache.service }} - name: {{ apache.service }}
- enable: True - enable: True

apache-reload:
cmd.wait:
- name: service apache2 reload

apache-restart:
cmd.wait:
- name: service apache2 restart


+ 1
- 0
apache/php5.sls View File



include: include:
- apt - apt
- apache


mod-php5: mod-php5:
pkg.installed: pkg.installed:

+ 3
- 0
apache/rewrite.sls View File



include: include:
- apt - apt
- apache


a2enmod rewrite: a2enmod rewrite:
cmd.run: cmd.run:
- unless: ls /etc/apache2/mods-enabled/rewrite.load - unless: ls /etc/apache2/mods-enabled/rewrite.load
- order: 225 - order: 225
- require:
- pkg: apache
- watch_in: - watch_in:
- cmd: apache-restart - cmd: apache-restart



+ 16
- 0
apache/vhost_alias.sls View File

{% if grains['os_family']=="Debian" %}

include:
- apt
- apache

a2enmod vhost_alias:
cmd.run:
- unless: ls /etc/apache2/mods-enabled/vhost_alias.load
- order: 225
- require:
- pkg: apache
- watch_in:
- cmd: apache-restart

{% endif %}

+ 3
- 1
apache/vhosts/standard.sls View File

- require: - require:
- pkg: apache - pkg: apache
- watch_in: - watch_in:
- service: apache
- cmd: apache-reload


{% if grains.os_family == 'Debian' %} {% if grains.os_family == 'Debian' %}
a2ensite {{ id }}: a2ensite {{ id }}:
- run - run
- require: - require:
- file: {{ id }} - file: {{ id }}
- watch_in:
- cmd: apache-reload
{% endif %} {% endif %}


{% endfor %} {% endfor %}

+ 11
- 3
apache/vhosts/standard.tmpl View File



'ServerAdmin': site.get('ServerAdmin', 'webmaster@{0}'.format(sitename)), 'ServerAdmin': site.get('ServerAdmin', 'webmaster@{0}'.format(sitename)),


'DirectoryIndex': site.get('DirectoryIndex'),
'UseCanonicalName': site.get('UseCanonicalName'),

'LogLevel': site.get('LogLevel', 'warn'), 'LogLevel': site.get('LogLevel', 'warn'),
'ErrorLog': site.get('ErrorLog', '{0}/{1}-error.log'.format(map.logdir, sitename)), 'ErrorLog': site.get('ErrorLog', '{0}/{1}-error.log'.format(map.logdir, sitename)),
'CustomLog': site.get('ErrorLog', '{0}/{1}-access.log'.format(map.logdir, sitename)),
'CustomLog': site.get('CustomLog', '{0}/{1}-access.log'.format(map.logdir, sitename)),


'DocumentRoot': site.get('DocumentRoot', '{0}/{1}'.format(map.wwwdir, sitename)), 'DocumentRoot': site.get('DocumentRoot', '{0}/{1}'.format(map.wwwdir, sitename)),
'VirtualDocumentRoot': site.get('VirtualDocumentRoot'),


'Directory_default': '{0}/{1}'.format(map.wwwdir, sitename), 'Directory_default': '{0}/{1}'.format(map.wwwdir, sitename),
'Directory': { 'Directory': {


{% if site.get('ServerAdmin') != False %}ServerAdmin {{ vals.ServerAdmin }}{% endif %} {% if site.get('ServerAdmin') != False %}ServerAdmin {{ vals.ServerAdmin }}{% endif %}


{% if site.get('DirectoryIndex') %}DirectoryIndex {{ vals.DirectoryIndex }}{% endif %}
{% if site.get('UseCanonicalName') %}UseCanonicalName {{ vals.UseCanonicalName }}{% endif %}

{% if site.get('LogLevel') != False %}LogLevel {{ vals.LogLevel }}{% endif %} {% if site.get('LogLevel') != False %}LogLevel {{ vals.LogLevel }}{% endif %}
{% if site.get('ErrorLog') != False %}ErrorLog {{ vals.ErrorLog }}{% endif %} {% if site.get('ErrorLog') != False %}ErrorLog {{ vals.ErrorLog }}{% endif %}
{% if site.get('CustomLog') != False %}CustomLog {{ vals.CustomLog }}{% endif %} {% if site.get('CustomLog') != False %}CustomLog {{ vals.CustomLog }}{% endif %}


{% if site.get('DocumentRoot') != False %}DocumentRoot {{ vals.DocumentRoot }}{% endif %} {% if site.get('DocumentRoot') != False %}DocumentRoot {{ vals.DocumentRoot }}{% endif %}
{% if site.get('VirtualDocumentRoot') %}VirtualDocumentRoot {{ vals.VirtualDocumentRoot }}{% endif %}


{% for path, dir in site.get('Directory', {}).items() %} {% for path, dir in site.get('Directory', {}).items() %}
{% set dvals = { {% set dvals = {
'Options': dir.get('Options', vals.Directory.Options), 'Options': dir.get('Options', vals.Directory.Options),
'Order': dir.get('Order', vals.Directory.Order), 'Order': dir.get('Order', vals.Directory.Order),
'Allow': dir.get('Order', vals.Directory.Allow),
'AllowOverride': dir.get('Order', vals.Directory.AllowOverride),
'Allow': dir.get('Allow', vals.Directory.Allow),
'AllowOverride': dir.get('AllowOverride', vals.Directory.AllowOverride),
} %} } %}


{% if path == 'default' %}{% set path = vals.Directory_default %}{% endif %} {% if path == 'default' %}{% set path = vals.Directory_default %}{% endif %}

Loading…
Cancel
Save