title: Logrotate with ansible playbook
body: <p>so i would like to create a ansible playbook that installs logrotate on all the servers in company. Also configs them to to set logs to be backed up weekly and then deleted a week after. So each week it makes a new log, backups last week log and on the third week it deletes the first one and repeats.</p>
  
  <p>So far i have found this but we do not use nginx. And it does not do exactly what i want. My knowledge in playbooks is quite limited so if someone could help with it would be awesome. Also i need it to check if the server has tomcat, apache or wildfly and then takes those logs.</p>
  
  <pre><code>logrotate_scripts:
    - name: nginx-options
      path: /var/log/nginx/options.log
        options:
        - daily
        - weekly
        - size 25M
        - rotate 7
        - missingok
        - compress
        - delaycompress
        - copytruncate
  </code></pre>