apache-formula/apache/mod_mpm.sls
Niels Abspoel 53b995a680 Improved apache-formula
- Added more modules and configuration options
 - Renamed sls files to reflect what they do.
 - added mpm options for Debian
2015-06-19 20:44:53 +02:00

39 lines
1.0 KiB
Plaintext

{% if grains['os_family']=="Debian" %}
{% from "apache/map.jinja" import apache with context %}
{% set mpm_module = salt['pillar.get']('apache:mpm:module', 'mpm_prefork') %}
include:
- apache
a2enmod {{ mpm_module }}:
cmd.run:
- unless: ls /etc/apache2/mods-enabled/{{ mpm_module }}.load
- require:
- pkg: apache
- watch_in:
- module: apache_restart
file.managed:
- name: /etc/apache2/mods-available/{{ mpm_module }}.conf
- template: jinja
- source:
- salt://apache/files/Debian/mpm/{{ mpm_module }}.conf.jinja
- require:
- pkg: apache
- watch_in:
- module: apache_restart
# Deactivate the other mpm modules as a previous step
{% for mod in ['mpm_prefork', 'mpm_worker', 'mpm_event'] if not mod == mpm_module %}
a2dismod {{ mod }}:
cmd.run:
- onlyif: test -e /etc/apache2/mods-enabled/{{ mod }}.load
- require:
- pkg: apache
- require_in:
- cmd: a2enmod {{ mpm_module }}
- watch_in:
- module: apache_restart
{% endfor %}
{% endif %}