Skip to content

Commit

Permalink
common: Ensure logrotate is installed and enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
JGoutin committed Aug 18, 2024
1 parent f0a6a7a commit 9f266fc
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions roles/common/tasks/journal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,27 @@
src: journald-max-use.conf.j2
dest: /etc/systemd/journald.conf.d/max-use.conf
mode: "0600"

- name: Ensure logrotate is installed
ansible.builtin.dnf:
state: present
name: logrotate
install_weak_deps: false
retries: 10
delay: 1
register: _
until: _ is successful
when: not (_ostree | bool)

- name: Ensure logrotate is installed
community.general.rpm_ostree_pkg:
state: present
name: logrotate
when: _ostree | bool

- name: Ensure logrotate service is started and enabled at boot
ansible.builtin.systemd:
name: logrotate.timer
state: started
enabled: true
tags: molecule-idempotence-notest

0 comments on commit 9f266fc

Please sign in to comment.