system: размер журнала systemd ограничен 500M
Без потолка journald занимает до 10% файловой системы; на сервере он успел дорасти до 745M. Лимит выставляется drop-in файлом в journald.conf.d.
This commit is contained in:
@@ -36,6 +36,27 @@
|
|||||||
security_autoupdate_enabled: true
|
security_autoupdate_enabled: true
|
||||||
security_fail2ban_enabled: true
|
security_fail2ban_enabled: true
|
||||||
|
|
||||||
|
- name: "Create systemd journald drop-in directory"
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /etc/systemd/journald.conf.d
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: "Limit systemd journal size"
|
||||||
|
ansible.builtin.copy:
|
||||||
|
content: |
|
||||||
|
# Managed by ansible (playbook-system.yml)
|
||||||
|
# Без потолка journald занимает до 10% ФС.
|
||||||
|
[Journal]
|
||||||
|
SystemMaxUse=500M
|
||||||
|
dest: /etc/systemd/journald.conf.d/99-max-use.conf
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0644"
|
||||||
|
notify: "Restart systemd-journald"
|
||||||
|
|
||||||
- name: "Copy keep files script"
|
- name: "Copy keep files script"
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: "files/keep-files.py"
|
src: "files/keep-files.py"
|
||||||
@@ -61,3 +82,9 @@
|
|||||||
when: mount_external_storage | default(false) | bool
|
when: mount_external_storage | default(false) | bool
|
||||||
tags:
|
tags:
|
||||||
- mount-storage
|
- mount-storage
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: "Restart systemd-journald"
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
name: systemd-journald
|
||||||
|
state: restarted
|
||||||
|
|||||||
Reference in New Issue
Block a user