ansible: configure log rotation of apache logs (bug 1347161); r?fubar draft
authorbyron jones <glob@mozilla.com>
Tue, 14 Mar 2017 22:56:33 +0800
changeset 10496 b41fe3bff2bf6a500e503c5cecb9ea221ae1ccbd
parent 10494 d4f3c5bd8a42f4c0b7113b927014aeccb35246b8
push id1565
push userbjones@mozilla.com
push dateTue, 14 Mar 2017 14:56:59 +0000
reviewersfubar
bugs1347161
ansible: configure log rotation of apache logs (bug 1347161); r?fubar MozReview-Commit-ID: FW0YjgdLOTA
ansible/roles/hg-reviewboard/files/logrotate.conf
ansible/roles/hg-reviewboard/tasks/main.yml
new file mode 100644
--- /dev/null
+++ b/ansible/roles/hg-reviewboard/files/logrotate.conf
@@ -0,0 +1,10 @@
+/var/log/httpd/*/*log {
+    daily
+    rotate 720
+    compress
+    delaycompress
+    notifempty
+    postrotate
+        /usr/bin/systemctl reload httpd.service > /dev/null
+    endscript
+}
--- a/ansible/roles/hg-reviewboard/tasks/main.yml
+++ b/ansible/roles/hg-reviewboard/tasks/main.yml
@@ -16,16 +16,19 @@
   with_items:
     - httpd
     # To build mod_wsgi from source.
     - httpd-devel
     # Used for validating Bugzilla API keys through HTTP pushes.
     - mod_authnz_external
     - sudo
 
+- name: add logrotate httpd config
+  copy: src=logrotate.conf dest=/etc/logrotate.d/hg-httpd-logrotate
+
 - name: Repository directories present
   file: path=/repo/hg/webroot_wsgi state=directory mode=0755
 
 - name: create virtualenv for hgweb
   include: ../../../tasks/virtualenv.yml
            venv=/var/hg/venv_hgweb
            requirements=../roles/hg-reviewboard/files/requirements-hgweb.txt