Skip to content

Commit

Permalink
Add log rotation for internal services to prevent out of disk issues (c…
Browse files Browse the repository at this point in the history
…loses #151)
  • Loading branch information
oguzhanunlu committed May 23, 2018
1 parent b857677 commit 412eb5a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions provisioning/roles/sp_mini_1_create_dirs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@
shell: 'adduser ubuntu --disabled-password --gecos "" ;
passwd -d ubuntu'

- name: Insert logrotate configuration for Snowplow Services
become: yes
copy:
dest: "/etc/logrotate.d/snowplow-apps"
content: |
/var/log/snowplow*.log /var/log/snowplow*.err /var/log/nsq*.log /var/log/nsq*.err /var/log/iglu_server*.log /var/log/iglu_server*.err {
hourly
rotate 3
missingok
notifempty
create 644 root root
}
mode: 0644

- name: Change logrotate cron to hourly
become: yes
shell: 'mv /etc/cron.daily/logrotate /etc/cron.hourly && service cron restart'

- name: creating directories
file: path={{item}} state=directory
with_items:
Expand Down

0 comments on commit 412eb5a

Please sign in to comment.