Commit 54e89f13 by Kevin Falcone Committed by GitHub

Merge pull request #3223 from edx/jibsheet/rotate-rabbitmq-queue-logs

Use logrotate to clean up from the log-queue-lenghts (sic) job
parents eb8a7178 d9f95193
FROM edxops/precise-common:latest
MAINTAINER edxops
USER root
ADD . /edx/app/edx_ansible/edx_ansible
WORKDIR /edx/app/edx_ansible/edx_ansible/docker/plays
# Role is currently untagged
RUN /edx/app/edx_ansible/venvs/edx_ansible/bin/ansible-playbook rabbitmq.yml -c local \
-i '127.0.0.1,'
USER rabbitmq
# TBD what we want to run rabbit under
EXPOSE 15672 5672
- name: Deploy rabbitmq
hosts: all
sudo: True
gather_facts: True
vars:
serial_count: 1
serial: "{{ serial_count }}"
roles:
- common_vars
- docker
- rabbitmq
......@@ -57,6 +57,15 @@
name: "log-queue-lenghts"
job: "{{ rabbitmq_app_dir }}/log-rabbitmq-queues.sh >/dev/null 2>&1"
- name: install logrotate configuration
template:
src: etc/logrotate.d/rabbitmq.j2
dest: /etc/logrotate.d/rabbitmq
tags:
- "install"
- "install:configuration"
- "logrotate"
# Defaulting to /var/lib/rabbitmq
- name: Create cookie directory
file:
......
# We want to hit the top level queues and any vhost queues
# such as notifier and fulfillment
{{ rabbitmq_log_dir }}/*.log {{ rabbitmq_log_dir }}/*/*.log {
compress
dateext
dateformat -%Y%m%d-%s
missingok
daily
rotate 3
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment