mirror of
https://github.com/luzifer-ansible/logrotate.git
synced 2024-12-23 02:01:17 +00:00
25 lines
614 B
YAML
25 lines
614 B
YAML
---
|
|
|
|
- name: Ensure logrotate is installed
|
|
apt:
|
|
name: logrotate
|
|
cache_valid_time: 86400
|
|
|
|
- name: Get logrotate version
|
|
command: 'logrotate --version'
|
|
changed_when: no
|
|
register: logrotate_version
|
|
|
|
- name: Install custom logrotate files
|
|
template:
|
|
src: templates/logrotate.j2
|
|
dest: '/etc/logrotate.d/{{ item.name }}'
|
|
with_items: '{{ logrotate_configs | default([]) }}'
|
|
|
|
- name: Test custom configurations
|
|
command: 'logrotate -d /etc/logrotate.d/{{ item.name }}'
|
|
with_items: '{{ logrotate_configs | default([]) }}'
|
|
changed_when: no
|
|
when: not '3.8.' in logrotate_version.stderr
|
|
|
|
...
|