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



Installs the Apache package and starts the service. Installs the Apache package and starts the service.


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

Enables and disables Apache modules.

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



+ 28
- 0
apache/modules.sls View File

{% 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

name: 'my name' name: 'my name'
path: 'salt://path/to/sites-available/conf/file' path: 'salt://path/to/sites-available/conf/file'
state: 'enabled' state: 'enabled'

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

Loading…
Cancel
Save