summaryrefslogtreecommitdiffstats
path: root/roles/openshift_gcp/tasks/frequent_log_rotation.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_gcp/tasks/frequent_log_rotation.yml')
-rw-r--r--roles/openshift_gcp/tasks/frequent_log_rotation.yml18
1 files changed, 18 insertions, 0 deletions
diff --git a/roles/openshift_gcp/tasks/frequent_log_rotation.yml b/roles/openshift_gcp/tasks/frequent_log_rotation.yml
new file mode 100644
index 000000000..0b4b27f84
--- /dev/null
+++ b/roles/openshift_gcp/tasks/frequent_log_rotation.yml
@@ -0,0 +1,18 @@
+---
+- name: Rotate logs daily
+ replace:
+ dest: /etc/logrotate.conf
+ regexp: '^weekly|monthly|yearly$'
+ replace: daily
+- name: Rotate at a smaller size of log
+ lineinfile:
+ dest: /etc/logrotate.conf
+ state: present
+ regexp: '^size'
+ line: size 10M
+- name: Limit total size of log files
+ lineinfile:
+ dest: /etc/logrotate.conf
+ state: present
+ regexp: '^maxsize'
+ line: maxsize 20M