Browse Source

Add ability to specify modules in pillar

master
Skyler Berg 10 years ago
parent
commit
11d66cfda7
3 changed files with 40 additions and 0 deletions
  1. +5
    -0
      README.rst
  2. +28
    -0
      apache/modules.sls
  3. +7
    -0
      pillar.example

+ 5
- 0
README.rst View File

@@ -20,6 +20,11 @@ Available states

Installs the Apache package and starts the service.

``apache.modules``
------------------

Enables and disables Apache modules.

``apache.mod_proxy``
-------------------


+ 28
- 0
apache/modules.sls View File

@@ -0,0 +1,28 @@
{% if grains['os_family']=="Debian" %}

include:
- apache

{% for module in salt['pillar.get']('apache:modules:enabled', []) %}
a2enmod {{ module }}:
cmd.run:
- unless: ls /etc/apache2/mods-enabled/{{ module }}.load
- order: 225
- require:
- pkg: apache
- watch_in:
- module: apache-restart
{% endfor %}

{% for module in salt['pillar.get']('apache:modules:disabled', []) %}
a2dismod {{ module }}:
cmd.run:
- onlyif: ls /etc/apache2/mods-enabled/{{ module }}.load
- order: 225
- require:
- pkg: apache
- watch_in:
- module: apache-restart
{% endfor %}

{% endif %}

+ 7
- 0
pillar.example View File

@@ -68,3 +68,10 @@ apache:
name: 'my name'
path: 'salt://path/to/sites-available/conf/file'
state: 'enabled'

modules:
enabled: # List modules to enable
- ldap
- ssl
disabled: # List modules to disable
- rewrite

Loading…
Cancel
Save