Setting default mpm in a better way
diff --git a/apache/server/service/mpm.sls b/apache/server/service/mpm.sls
index ff7907e..58a6e94 100644
--- a/apache/server/service/mpm.sls
+++ b/apache/server/service/mpm.sls
@@ -5,7 +5,7 @@
{%- for mpm_type, mpm in server.mpm.iteritems() %}
-{%- if mpm.enabled %}
+{%- if mpm_type == server.get('default_mpm', 'prefork') %}
apache_mpm_{{ mpm_type }}_enable:
cmd.run:
diff --git a/metadata/service/server/single.yml b/metadata/service/server/single.yml
index f458125..a80124b 100644
--- a/metadata/service/server/single.yml
+++ b/metadata/service/server/single.yml
@@ -15,9 +15,9 @@
modules:
- ssl
- rewrite
+ default_mpm: prefork
mpm:
prefork:
- enabled: true
servers:
start: 5
spare:
@@ -30,7 +30,6 @@
# Should be same or more than max clients
limit: ${apache:server:mpm:prefork:max_clients}
event:
- enabled: false
servers:
start: 5
spare:
@@ -43,7 +42,6 @@
max_clients: 150
limit: 64
worker:
- enabled: false
servers:
start: 5
spare:
diff --git a/tests/pillar/apache_server.sls b/tests/pillar/apache_server.sls
index 2a4ac0b..da59713 100644
--- a/tests/pillar/apache_server.sls
+++ b/tests/pillar/apache_server.sls
@@ -53,6 +53,7 @@
- lists.example.com
- mail01.example.com
- mail01
+ default_mpm: prefork
mpm:
prefork:
enabled: true
@@ -67,7 +68,3 @@
max_clients: 150
# Should be same or more than max clients
limit: ${apache:server:mpm:prefork:max_clients}
- event:
- enabled: false
- worker:
- enabled: true