ansible-role-nginx/tasks/conf/logrotate.yml
Alessandro Fael Garcia bf2916fc55
Update Ansible to 2.9.12 and explicitly set mode on relevant tasks (#309)
*   Explicitly define `mode` in relevant tasks.
*   Explicitly define the `nginx` `apt_repository` filename in Debian based distros.
*   Building OpenSSL from source should now work properly in CentOS 8.
2020-08-28 10:30:23 +02:00

36 lines
913 B
YAML

---
- 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"
mode: 0644
notify: "(Config: All OSs) Run Logrotate"