---
- name: Configure logrotate
  template:
    src: templates/logrotate.j2
    dest: /etc/logrotate.d/eth-log-alerting
    force: yes
    owner: root
    group: root
    mode: 0644
  when: eth_log_alerting_debug_dest != "os.Stdout"

- name: Remove logrotate configuration
  file:
    dest: /etc/logrotate.d/eth-log-alerting
    state: absent
  when: eth_log_alerting_debug_dest == "os.Stdout"
