2020-09-15 21:27:06 +02:00
|
|
|
---
|
2020-09-18 19:51:50 +02:00
|
|
|
- name: "(Alpine Linux) Install logrotate"
|
2020-09-15 21:27:06 +02:00
|
|
|
apk:
|
|
|
|
name: logrotate
|
|
|
|
when: ansible_facts['os_family'] == "Alpine"
|
|
|
|
|
2020-09-18 19:51:50 +02:00
|
|
|
- name: "(Debian/Ubuntu) Install logrotate"
|
2020-09-15 21:27:06 +02:00
|
|
|
apt:
|
|
|
|
name: logrotate
|
|
|
|
state: present
|
|
|
|
when: ansible_facts['os_family'] == "Debian"
|
|
|
|
|
2020-09-18 19:51:50 +02:00
|
|
|
- name: "(Amazon Linux/CentOS/Oracle Linux/RHEL) Install logrotate"
|
2020-09-15 21:27:06 +02:00
|
|
|
yum:
|
|
|
|
name: logrotate
|
|
|
|
state: present
|
|
|
|
when: ansible_facts['os_family'] == "RedHat"
|
|
|
|
|
2020-09-18 19:51:50 +02:00
|
|
|
- name: "(SLES) Set up logrotate"
|
2020-09-15 21:27:06 +02:00
|
|
|
block:
|
2020-09-18 19:51:50 +02:00
|
|
|
- name: "(SLES) Configure logrotate repository"
|
2020-09-15 21:27:06 +02:00
|
|
|
zypper_repository:
|
|
|
|
repo: https://download.opensuse.org/repositories/openSUSE:Leap:42.1/standard/openSUSE:Leap:42.1.repo
|
|
|
|
|
2020-09-18 19:51:50 +02:00
|
|
|
- name: "(SLES) Install Logrotate"
|
2020-09-15 21:27:06 +02:00
|
|
|
zypper:
|
|
|
|
name: logrotate
|
|
|
|
state: present
|
|
|
|
when: ansible_facts['os_family'] == "Suse"
|
|
|
|
|
|
|
|
- name: "Create logrotate config"
|
|
|
|
template:
|
|
|
|
src: "logrotate/nginx.j2"
|
|
|
|
dest: "/etc/logrotate.d/nginx"
|
|
|
|
mode: 0644
|
|
|
|
notify: "(Handler) Run logrotate"
|