| # FIXME: replace this with KeepFree=10G in /etc/systemd/journal-remote.conf once we're on systemd v253+ |
| - cron: |
| name: 'Periodically rotate old log files' |
| minute: '*/20' |
| hour: '*' |
| job: 'journalctl --directory /var/log/journal/remote --rotate --vacuum-size=180G' |
| |
| - package: |
| name: '{{ item }}' |
| state: present |
| with_items: |
| - python3-systemd |
| |
| - user: |
| name: '{{ log_user }}' |
| group: systemd-journal-remote |
| comment: Analyze incoming journald logs for CzechLight |
| |
| - copy: |
| src: 'files/czechlight-journal-analyzer/czechlight-journal-analyzer.py' |
| dest: '/usr/bin/czechlight-journal-analyzer.py' |
| mode: 0755 |
| notify: restart czechlight-journal-analyzer |
| |
| - template: |
| src: 'files/czechlight-journal-analyzer/czechlight-journal-analyzer.service' |
| dest: '/etc/systemd/system/czechlight-journal-analyzer.service' |
| mode: 0644 |
| notify: restart czechlight-journal-analyzer |
| |
| - service: |
| name: czechlight-journal-analyzer |
| enabled: true |
| state: started |