From a3885e6d69d1273d2ac96d7c290ca1a32e496332 Mon Sep 17 00:00:00 2001 From: Carlo Vollebregt Date: Thu, 19 Nov 2015 22:04:03 +0100 Subject: [PATCH] Added installation support for mod_pagespeed on RedHat --- README.rst | 2 +- apache/map.jinja | 2 ++ apache/mod_pagespeed.sls | 9 ++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 52caced..83a97e6 100644 --- a/README.rst +++ b/README.rst @@ -68,7 +68,7 @@ Enables the Apache module mod_headers. (Debian Only) ``apache.mod_pagespeed`` ------------------------ -Installs and Enables the mod_pagespeed module. (Debian Only) +Installs and Enables the mod_pagespeed module. (Debian and RedHat Only) ``apache.mod_php5`` ------------------- diff --git a/apache/map.jinja b/apache/map.jinja index 1a116a4..1276952 100644 --- a/apache/map.jinja +++ b/apache/map.jinja @@ -9,6 +9,7 @@ 'mod_wsgi': 'libapache2-mod-wsgi', 'mod_php5': 'libapache2-mod-php5', 'mod_fcgid': 'libapache2-mod-fcgid', + 'mod_pagespeed_source': 'https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb', 'vhostdir': '/etc/apache2/sites-available', 'confdir': '/etc/apache2/conf.d', @@ -26,6 +27,7 @@ 'mod_wsgi': 'mod_wsgi', 'mod_php5': 'php', + 'mod_pagespeed_source': 'https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm', 'vhostdir': '/etc/httpd/vhosts.d', 'confdir': '/etc/httpd/conf.d', diff --git a/apache/mod_pagespeed.sls b/apache/mod_pagespeed.sls index 0d26a47..4d76a1f 100644 --- a/apache/mod_pagespeed.sls +++ b/apache/mod_pagespeed.sls @@ -1,4 +1,3 @@ -{% if grains['os_family']=="Debian" %} {% from "apache/map.jinja" import apache with context %} include: @@ -8,9 +7,9 @@ libapache2-mod-pagespeed: pkg: - installed - sources: - - mod-pagespeed-stable: https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb - + - mod-pagespeed-stable: {{ apache.mod_pagespeed_source }} +{% if grains['os_family']=="Debian" %} a2enmod pagespeed: cmd.run: - unless: ls /etc/apache2/mods-enabled/pagespeed.load @@ -19,7 +18,7 @@ a2enmod pagespeed: - pkg: libapache2-mod-pagespeed - watch_in: - service: apache - +{% endif %} {% for dir in ['/var/cache/mod_pagespeed', '/var/log/pagespeed'] %} {{ dir }}: @@ -34,6 +33,7 @@ a2enmod pagespeed: - group: {{ salt['pillar.get']('apache:group', 'www-data') }} {% endfor %} +{% if grains['os_family']=="Debian" %} # Here we hardcode a logrotate entry to take care of the logs /etc/logrorate.d/pagespeed: file: @@ -53,5 +53,4 @@ a2enmod pagespeed: fi; endscript } - {% endif %}