Commit 0e784a4 1 parent e5072ae commit 0e784a4 Copy full SHA for 0e784a4
File tree 3 files changed +23
-0
lines changed
3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 8
8
ansible.builtin.service :
9
9
name : sshd
10
10
state : restarted
11
+ - name : Restart systemd-journald
12
+ ansible.builtin.service :
13
+ name : systemd-journald
14
+ state : restarted
Original file line number Diff line number Diff line change 31
31
- name : Install and configure certbot
32
32
ansible.builtin.include_tasks : install_certbot.yaml
33
33
34
+ # # Setup systemd
35
+ - name : Setup systemd journal rotation
36
+ ansible.builtin.include_tasks : setup_systemd_journal.yaml
37
+
34
38
# # Setup Monitoring service
35
39
- name : Configure monitoring service
36
40
ansible.builtin.include_tasks : setup_monitor.yaml
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : Setup systemd journal rotation
3
+ ansible.builtin.blockinfile :
4
+ path : /etc/systemd/journald.conf
5
+ block : |
6
+ [Journal]
7
+ SystemMaxUse=2G
8
+ SystemMaxFileSize=100M
9
+ MaxRetentionSec=30d
10
+ Compress=yes
11
+ notify : Restart systemd-journald
12
+
13
+ - name : Force immediate cleanup of old journals
14
+ ansible.builtin.command : journalctl --vacuum-time=30d
15
+ changed_when : true
You can’t perform that action at this time.
0 commit comments