Skip to content

Commit

Permalink
YDA-5707: Add MOAI logrotate configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
claravox authored and stsnel committed Aug 5, 2024
1 parent 5c0462b commit 7092bd0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions roles/yoda_moai/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,17 @@
creates: '{{ yoda_moai_home }}/moai.log'


- name: Install logrotate settings for MOAI log files
ansible.builtin.template:
src: moai.j2
dest: /etc/logrotate.d/moai
owner: root
group: root
mode: '0644'
# TODO enable for RedHat as well once determined the needed selinux changes?
when: ansible_os_family == 'Debian'


- name: Set SELinux context for MOAI log file
community.general.sefcontext:
target: '{{ yoda_moai_home }}/moai.log'
Expand Down
11 changes: 11 additions & 0 deletions roles/yoda_moai/templates/moai.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# {{ ansible_managed }}

{{ yoda_moai_home }}/*.log {
weekly
missingok
rotate 4
compress
delaycompress
notifempty
su {{ yoda_moai_user }} {{ yoda_moai_user }}
}

0 comments on commit 7092bd0

Please sign in to comment.