---
- name: cron | Create fstrim daily job
  copy:
    src: fstrim
    dest: /etc/periodic/daily/fstrim
    owner: root
    group: root
    mode: 0755

# It is recomended to preserve /var/tmp across reboots
- name: cron | Create empty /var/tmp/ weekly job
  copy:
    src: empty-tmp
    dest: /etc/periodic/weekly/empty-tmp
    owner: root
    group: root
    mode: 0755

- name: cron | Create btrfs-scrub monthly job
  copy:
    src: btrfs-scrub
    dest: /etc/periodic/monthly/btrfs-scrub
    owner: root
    group: root
    mode: 0755
  when: rootfs == 'btrfs'

- name: cron | Install logrotate and cpulimit
  apk:
    name: logrotate, cpulimit
    state: present

- name: cron | Add crond service to runlevel 'default'
  service:
    name: crond
    runlevel: default
    enabled: yes
    state: started
