Skip to content

Commit

Permalink
edit logrotate.timer from daily to hourly (#294)
Browse files Browse the repository at this point in the history
* edit logrotate.timer from daily to hourly

* some reworking

* No we're playing with fire

* onchanges over require

* Update logrotate.timer using ini_manage

* fix trailing whitespace

* Update salt/cdn-logs/init.sls

* Update salt/cdn-logs/init.sls

Co-authored-by: Ee Durbin <ee@python.org>
  • Loading branch information
cegerhardson and ewdurbin committed Jan 11, 2023
1 parent d6c01b1 commit 7be5b18
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update -y && apt-get dist-upgrade -y

# Install system dependencies, you may not need all of these
RUN apt-get install -y --no-install-recommends ssh sudo libffi-dev systemd openssh-client wget gnupg-utils gnupg apt-utils ca-certificates dbus locales cron dialog rsyslog iproute2
RUN apt-get install -y --no-install-recommends ssh sudo libffi-dev systemd openssh-client wget gnupg-utils gnupg apt-utils ca-certificates dbus locales cron dialog rsyslog iproute2 logrotate

RUN locale-gen en_US.UTF-8
COPY ./docker/etc/locale.conf /etc/locale.conf
Expand Down
16 changes: 13 additions & 3 deletions salt/cdn-logs/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
file.managed:
- source: salt://cdn-logs/config/fastly.logrotate.conf

/etc/cron.hourly/logrotate:
file.symlink:
- target: /etc/cron.daily/logrotate
/etc/systemd/system/timers.target.wants/logrotate.timer:
ini.options_present:
- name: /etc/systemd/system/timers.target.wants/logrotate.timer
- separator: '='
- sections:
Unit:
Description: 'Hourly rotation of log files'
Timer:
OnCalendar: hourly
cmd.run:
- name: systemctl daemon-reload
- onchanges:
- ini: /etc/systemd/system/timers.target.wants/logrotate.timer

0 comments on commit 7be5b18

Please sign in to comment.