ansible-role-nginx/tasks/conf/logrotate.yml

35 lines
898 B
YAML
Raw Normal View History

2020-05-19 22:51:08 +02:00
---
- name: "(Config: Alpine) Install Logrotate"
apk:
name: logrotate
when: ansible_os_family == "Alpine"
- name: "(Config: Ubuntu/Debian) Install Logrotate"
apt:
name: logrotate
state: present
when: ansible_os_family == "Debian"
- name: "(Config: CentOS/RedHat) Install Logrotate"
yum:
name: logrotate
state: present
when: ansible_os_family == "RedHat"
- name: "(Config: SUSE) Add Logrotate Repo"
zypper_repository:
repo: https://download.opensuse.org/repositories/openSUSE:Leap:42.1/standard/openSUSE:Leap:42.1.repo
when: ansible_os_family == "Suse"
- name: "(Config: SUSE) Install Logrotate"
zypper:
name: logrotate
state: present
when: ansible_os_family == "Suse"
- name: "(Config: All OSs) Create Logrotate Config"
template:
src: "logrotate/nginx.j2"
dest: "/etc/logrotate.d/nginx"
notify: "(Config: All OSs) Run Logrotate"