2020-01-28 21:39:05 +00:00
|
|
|
---
|
|
|
|
- block:
|
|
|
|
- name: Install logrotate packages
|
|
|
|
package:
|
|
|
|
name: "{{ logrotate_package }}"
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Create logrotate configuration file
|
|
|
|
template:
|
|
|
|
src: etc/logrotate.conf.j2
|
|
|
|
dest: /etc/logrotate.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
|
|
|
|
- name: Create logrotate application configuration files
|
|
|
|
template:
|
|
|
|
src: etc/logrotate.d/config.j2
|
|
|
|
dest: "/etc/logrotate.d/{{ item.name }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2021-05-25 21:28:54 +00:00
|
|
|
loop: "{{ logrotate_config + logrotate_app_config + logrotate_app_config_extra }}"
|
2020-01-28 21:39:05 +00:00
|
|
|
loop_control:
|
|
|
|
label: "/etc/logrotate.d/{{ item.name }}"
|
|
|
|
become: True
|
|
|
|
become_user: root
|