diff --git a/README.rst b/README.rst index f7b6147..94382db 100644 --- a/README.rst +++ b/README.rst @@ -70,6 +70,11 @@ Enables the Apache module mod_headers. (Debian Only) Installs and Enables the mod_pagespeed module. (Debian and RedHat Only) +``apache.mod_perl2`` +------------------- + +Installs and enables the mod_perl2 module (Debian and FreeBSD only) + ``apache.mod_php5`` ------------------- diff --git a/apache/files/FreeBSD/mod_perl.conf.jinja b/apache/files/FreeBSD/mod_perl.conf.jinja new file mode 100644 index 0000000..6a525f4 --- /dev/null +++ b/apache/files/FreeBSD/mod_perl.conf.jinja @@ -0,0 +1,3 @@ +{% from "apache/map.jinja" import apache with context %} + +LoadModule perl_module libexec/{{ apache.service }}/mod_perl.so diff --git a/apache/map.jinja b/apache/map.jinja index 0b6398d..9b69de7 100644 --- a/apache/map.jinja +++ b/apache/map.jinja @@ -28,6 +28,7 @@ 'mod_wsgi': 'libapache2-mod-wsgi', 'mod_php5': 'libapache2-mod-php5', + 'mod_perl2': 'libapache2-mod-perl2', 'mod_fcgid': 'libapache2-mod-fcgid', 'mod_pagespeed_source': 'https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb', @@ -86,6 +87,7 @@ 'portsfile': '/usr/local/etc/apache22/ports.conf', 'mod_php5': 'mod_php56', + 'mod_perl2': 'ap22-mod_perl2', 'mod_wsgi': 'ap22-mod_wsgi3', 'vhostdir': '/usr/local/etc/apache22/Includes', diff --git a/apache/mod_perl2.sls b/apache/mod_perl2.sls new file mode 100644 index 0000000..16b9e24 --- /dev/null +++ b/apache/mod_perl2.sls @@ -0,0 +1,35 @@ +{% from "apache/map.jinja" import apache with context %} + +include: + - apache + +mod-perl2: + pkg.installed: + - name: {{ apache.mod_perl2 }} + - order: 180 + - require: + - pkg: apache + +{% if grains['os_family']=="Debian" %} +a2enmod perl2: + cmd.run: + - unless: ls /etc/apache2/mods-enabled/perl2.load + - order: 225 + - require: + - pkg: mod-perl2 + - watch_in: + - module: apache-restart + +{% elif grains['os_family']=="FreeBSD" %} + +{{ apache.modulesdir }}/260_mod_perl.conf: + file.managed: + - source: salt://apache/files/{{ salt['grains.get']('os_family') }}/mod_perl.conf.jinja + - mode: 644 + - template: jinja + - require: + - pkg: apache + - watch_in: + - module: apache-restart + +{% endif %}