2019-08-03 12:53:21 +02:00
|
|
|
---
|
|
|
|
- name: Converge
|
|
|
|
hosts: all
|
2019-11-03 15:07:38 +01:00
|
|
|
pre_tasks:
|
2019-11-22 15:52:34 +01:00
|
|
|
- name: "Set repo if Alpine"
|
|
|
|
set_fact:
|
2020-06-08 15:46:01 +02:00
|
|
|
version: "=1.17.10-r1"
|
2019-11-22 15:52:34 +01:00
|
|
|
when: ansible_os_family == "Alpine"
|
2019-11-03 15:07:38 +01:00
|
|
|
- name: "Set repo if Debian"
|
|
|
|
set_fact:
|
2020-06-08 15:46:01 +02:00
|
|
|
version: "=1.17.10-1~{{ ansible_distribution_release }}"
|
2019-11-03 15:07:38 +01:00
|
|
|
when: ansible_os_family == "Debian"
|
|
|
|
- name: "Set repo if RedHat"
|
|
|
|
set_fact:
|
2020-06-08 15:46:01 +02:00
|
|
|
version: "-1.17.10-1.el{{ ansible_distribution_major_version }}.ngx"
|
2019-11-03 15:07:38 +01:00
|
|
|
when: ansible_os_family == "RedHat"
|
2020-06-18 14:34:51 +02:00
|
|
|
- name: "Enable Nginx @CentOS-AppStream dnf modules"
|
|
|
|
shell:
|
|
|
|
args:
|
|
|
|
cmd: dnf module info nginx | grep -q 'Stream.*\[e\]' && echo -n ENABLED || dnf module enable -y nginx # noqa 204 303
|
|
|
|
register: dnf_module_enable
|
|
|
|
changed_when: dnf_module_enable.stdout != 'ENABLED'
|
|
|
|
when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "8"
|
2019-08-03 12:53:21 +02:00
|
|
|
roles:
|
|
|
|
- role: ansible-role-nginx
|
2019-11-03 15:07:38 +01:00
|
|
|
vars:
|
2020-06-04 13:05:38 +02:00
|
|
|
nginx_debug_output: true
|
|
|
|
|
2019-11-03 15:07:38 +01:00
|
|
|
nginx_version: "{{ version }}"
|
2020-06-04 13:05:38 +02:00
|
|
|
nginx_logrotate_conf_enable: true
|
|
|
|
nginx_logrotate_conf:
|
|
|
|
paths:
|
|
|
|
- "/var/log/nginx/*.log"
|
|
|
|
options:
|
|
|
|
- daily
|
|
|
|
- missingok
|
|
|
|
- rotate 14
|
|
|
|
- compress
|
|
|
|
- delaycompress
|
|
|
|
- notifempty
|
|
|
|
- sharedscripts
|