Add logrotate meta configuration for HAProxy
- parametrize interval and rotation
Related: PROD-29848
Change-Id: I921daff99599be17731e90edb9c78657097d84cf
diff --git a/haproxy/meta/logrotate.yml b/haproxy/meta/logrotate.yml
new file mode 100644
index 0000000..9590a5b
--- /dev/null
+++ b/haproxy/meta/logrotate.yml
@@ -0,0 +1,17 @@
+## Default: Daily rotation with 52 rotations kept
+{%- from "haproxy/map.jinja" import proxy with context %}
+{%- if proxy.get('enabled', False) %}
+job:
+ haproxy:
+ - files:
+ - /var/log/haproxy.log
+ options:
+ - {{ proxy.get('logrotate', {}).get('interval', 'daily') }}
+ - rotate: {{ proxy.get('logrotate', {}).get('rotate', 52) }}
+ - missingok
+ - compress
+ - delaycompress
+ - notifempty
+ - postrotate:
+ invoke-rc.d rsyslog rotate >/dev/null 2>&1 || true
+{%- endif %}