Add logrotate meta configuration for Barbican
- parametrize interval and rotate
Related: PROD-29848
Change-Id: Ic5580e67d26707a8a915ea1c44610e4805c457e3
(cherry picked from commit bd942d91d4da07ae4a0915113add50c75d7cec9b)
diff --git a/barbican/meta/logrotate.yml b/barbican/meta/logrotate.yml
new file mode 100644
index 0000000..fb796cb
--- /dev/null
+++ b/barbican/meta/logrotate.yml
@@ -0,0 +1,16 @@
+## Default: Daily rotation with 28 rotations kept
+{%- from "barbican/map.jinja" import server with context %}
+
+{%- if server.get('enabled', False) %}
+job:
+ barbican-common:
+ - files:
+ - /var/log/barbican/*.log
+ options:
+ - {{ server.get('logrotate', {}).get('interval', 'daily') }}
+ - rotate: {{ server.get('logrotate', {}).get('rotate', 28) }}
+ - missingok
+ - compress
+ - delaycompress
+ - copytruncate
+{%- endif %}