Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Docker Debug Log from logrotate #78

Merged
merged 4 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions roles/logrotate/tasks/logrotate-clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Ensure Old Entries Removed
ansible.builtin.file:
path: "/etc/logrotate.d/{{ item.name }}"
state: absent
force: true
loop: "{{ logrotate.legacy }}"
4 changes: 3 additions & 1 deletion roles/logrotate/tasks/logrotate-purge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
path: "/etc/logrotate.d/{{ item.name }}"
state: absent
force: true
loop: "{{ logrotate.service }}"
loop:
- "{{ logrotate.service }}"
- "{{ logrotate.legacy }}"
16 changes: 16 additions & 0 deletions roles/logrotate/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,19 @@
- logrotate-purge
- purge
- never

- name: Cleanup Log Rotate
ansible.builtin.include_tasks:
file: logrotate-clean.yml
apply:
tags:
- logrotate-install
- logrotate-clean
- logrotate
- all
tags:
- logrotate-install
- logrotate-clean
- logrotate
- all
- never
1 change: 1 addition & 0 deletions vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ logrotate:
path: "/var/log/mongodb/*.log"
rotate: "daily"
number: "14"
legacy:
- name: "docker_debug_log"
path: "/var/lib/docker/containers/*/*.log"
rotate: "daily"
Expand Down