Saltstack Official Apache Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.4KB

  1. {% from "apache/map.jinja" import apache with context %}
  2. include:
  3. - apache
  4. libapache2-mod-pagespeed:
  5. pkg:
  6. - installed
  7. - sources:
  8. - mod-pagespeed-stable: {{ apache.mod_pagespeed_source }}
  9. {% if grains['os_family']=="Debian" %}
  10. a2enmod pagespeed:
  11. cmd.run:
  12. - unless: ls /etc/apache2/mods-enabled/pagespeed.load
  13. - order: 255
  14. - require:
  15. - pkg: libapache2-mod-pagespeed
  16. - watch_in:
  17. - module: apache-restart
  18. - require_in:
  19. - module: apache-restart
  20. - module: apache-reload
  21. - service: apache
  22. {% for dir in ['/var/cache/mod_pagespeed', '/var/log/pagespeed'] %}
  23. {{ dir }}:
  24. file:
  25. - directory
  26. - makedirs: true
  27. - user: {{ apache.user }}
  28. - group: {{ apache.group }}
  29. - require:
  30. - pkg: libapache2-mod-pagespeed
  31. - user: {{ apache.user }}
  32. - group: {{ apache.group }}
  33. {% endfor %}
  34. # Here we hardcode a logrotate entry to take care of the logs
  35. /etc/logrotate.d/pagespeed:
  36. file:
  37. - managed
  38. - contents: |
  39. /var/log/pagespeed/*.log {
  40. weekly
  41. missingok
  42. rotate 52
  43. compress
  44. delaycompress
  45. notifempty
  46. sharedscripts
  47. postrotate
  48. if /etc/init.d/apache2 status > /dev/null ; then \
  49. /etc/init.d/apache2 reload > /dev/null; \
  50. fi;
  51. endscript
  52. }
  53. {% endif %}