Skip to content

Commit

Permalink
Set log_size_max size for podman logs
Browse files Browse the repository at this point in the history
The service logs after a while can be really huge.
This change is limiting log file size to 1GB.
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

Depends-On: https://softwarefactory-project.io/r/c/software-factory/sf-ci/+/28529

Change-Id: Ia6071e5214644bdd126cf696cd437c140fa95c94
  • Loading branch information
danpawlik committed Jun 14, 2023
1 parent 1312241 commit b70376a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ansible/roles/sf-base/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ base_sysctl:
user.max_user_namespaces: 31089
kernel.sysrq: 0
vm.swappiness: 10

# set 1000MB in bytes
log_size_max: 1048576000
8 changes: 8 additions & 0 deletions ansible/roles/sf-base/tasks/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,11 @@
- name: Trust crt
shell: update-ca-trust
when: new_crt is changed

- name: Set max log limit in libpod configuration file
become: true
lineinfile:
path: /etc/containers/libpod.conf
regexp: "^max_log_size"
line: "max_log_size={{ log_size_max }}"
create: true

0 comments on commit b70376a

Please sign in to comment.