---
- name: set logrotate interval to daily
  sudo: yes
  lineinfile:
    dest: /etc/logrotate.conf
    regexp: '^weekly'
    line: "daily"
  tags:
    - logrotate

- name: set logrotate retention period to 7 days
  sudo: yes
  lineinfile:
    dest: /etc/logrotate.conf
    regexp: '^rotate 4'
    line: "rotate 7"
  tags:
    - logrotate

- name: configure mesos logrotate
  sudo: yes
  copy:
    src: mesos
    dest: /etc/logrotate.d/mesos
    mode: 0644
    owner: root
    group: root
  tags:
    - logrotate

- name: create mesos archive
  sudo: yes
  file:
    path: /var/log/mesos/archive
    mode: 0755
    state: directory
  tags:
    - logrotate

- name: configure docker logrotate
  sudo: yes
  copy:
    src: docker
    dest: /etc/logrotate.d/docker
    mode: 0644
    owner: root
    group: root
  tags:
    - logrotate

---
- name: set logrotate interval to daily
  sudo: yes
  lineinfile:
    dest: /etc/logrotate.conf
    regexp: '^weekly'
    line: "daily"
    backrefs: yes
  tags:
    - logrotate

- name: set logrotate retention period to 7 days
  sudo: yes
  lineinfile:
    dest: /etc/logrotate.conf
    regexp: '^rotate 4'
    line: "rotate 7"
    backrefs: yes
  tags:
    - logrotate

- name: configure mesos logrotate
  sudo: yes
  copy:
    src: mesos
    dest: /etc/logrotate.d/mesos
    mode: 0644
    owner: root
    group: root
  tags:
    - logrotate

- name: create mesos archive
  sudo: yes
  file:
    path: /var/log/mesos/archive
    mode: 0755
    state: directory
  tags:
    - logrotate

- name: configure docker logrotate
  sudo: yes
  copy:
    src: docker
    dest: /etc/logrotate.d/docker
    mode: 0644
    owner: root
    group: root
  tags:
    - logrotate

Fix logrotate role to be idempotent
Fix logrotate role to be idempotent
