-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set log_size_max size for podman logs
Sometimes the logs can take over 20GB in few weeks. By setting 1GB as log_size_max should avoid situation that we are out of the disk few times per week. The feature has been added into the podman containers.conf file in podman 2.2.0 release [1], but on Centos 7, version is below 2.2.0. According to the libpod.conf man [2], that option should be also available in podman 1.6.4, but it is located in libpod.conf file. More info [3]. [1] https://github.com/containers/podman/releases/tag/v2.2.0 [2] https://manpages.debian.org/unstable/podman/libpod.conf.5.en.html [3] unifi-utilities/unifios-utilities#100 Change-Id: Ic6d01e11606c9526d1880583876d76c4415250ac
- Loading branch information
Showing
4 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
roles: | ||
- service/node-exporter | ||
- system/update-host | ||
- system/podman | ||
|
||
- hosts: backup-rdo | ||
roles: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
- infra/ssh | ||
- service/node-exporter | ||
- system/update-host | ||
- system/podman | ||
|
||
- hosts: backup-sf | ||
roles: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
# set 1000MB in bytes | ||
log_size_max: 1048576000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
- name: Set max log limit - new way | ||
become: true | ||
ini_file: | ||
path: /etc/containers/containers.conf | ||
section: containers | ||
option: log_size_max | ||
value: "{{ log_size_max }}" | ||
backup: true | ||
|
||
- name: Set max log limit - legacy | ||
become: true | ||
lineinfile: | ||
path: /etc/containers/libpod.conf | ||
regexp: "^max_log_size" | ||
line: "max_log_size={{ log_size_max }}" | ||
create: true | ||
when: ansible_distribution_major_version|int < 8 |