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 8, 2018
1 parent 3a288a5 commit e0607f1
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_stream_collector.* /var/log/snowplow_stream_enrich.* /var/log/snowplow_elasticsearch_loader_* /var/log/nsqlookupd.* /var/log/nsqd.* /var/log/iglu_server_0.3.0.* {
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 e0607f1

Please sign in to comment.