---
- name: Rotate logs daily
  replace:
    dest: /etc/logrotate.conf
    regexp: '^weekly|monthly|yearly$'
    replace: daily
- name: Rotate at a smaller size of log
  lineinfile:
    dest: /etc/logrotate.conf
    state: present
    regexp: '^size'
    line: size 10M
- name: Limit total size of log files
  lineinfile:
    dest: /etc/logrotate.conf
    state: present
    regexp: '^maxsize'
    line: maxsize 20M
