2019-08-03 12:53:21 +02:00
|
|
|
---
|
|
|
|
- name: Converge
|
|
|
|
hosts: all
|
2019-11-03 15:07:38 +01:00
|
|
|
pre_tasks:
|
2020-08-19 18:39:17 +02:00
|
|
|
- name: Set repo if Alpine
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.set_fact:
|
2022-02-02 19:01:38 +01:00
|
|
|
version: "=1.21.5-r1"
|
2020-09-15 21:27:06 +02:00
|
|
|
when: ansible_facts['os_family'] == "Alpine"
|
2020-08-19 18:39:17 +02:00
|
|
|
- name: Set repo if Debian
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.set_fact:
|
2022-02-02 19:01:38 +01:00
|
|
|
version: "=1.21.5-1~{{ ansible_facts['distribution_release'] }}"
|
2020-09-15 21:27:06 +02:00
|
|
|
when: ansible_facts['os_family'] == "Debian"
|
|
|
|
- name: Set repo if Red Hat
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.set_fact:
|
2022-03-17 23:50:41 +01:00
|
|
|
version: "-1.21.5-1.{{ (ansible_facts['distribution'] == 'Amazon') | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx"
|
2020-09-15 21:27:06 +02:00
|
|
|
when: ansible_facts['os_family'] == "RedHat"
|
2020-08-19 18:39:17 +02:00
|
|
|
tasks:
|
|
|
|
- name: Install NGINX
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.include_role:
|
2020-08-19 18:39:17 +02:00
|
|
|
name: ansible-role-nginx
|
|
|
|
vars:
|
2022-03-17 23:50:41 +01:00
|
|
|
nginx_version: "{{ version }}"
|
|
|
|
nginx_service_modify: true
|
|
|
|
nginx_service_timeout: 95
|
2020-08-19 18:39:17 +02:00
|
|
|
nginx_selinux: true
|
|
|
|
nginx_selinux_tcp_ports:
|
|
|
|
- 80
|
|
|
|
- 443
|
|
|
|
nginx_logrotate_conf_enable: true
|
|
|
|
nginx_logrotate_conf:
|
|
|
|
paths:
|
2020-09-19 17:32:17 +02:00
|
|
|
- /var/log/nginx/*.log
|
2020-08-19 18:39:17 +02:00
|
|
|
options:
|
|
|
|
- daily
|
|
|
|
- missingok
|
|
|
|
- rotate 14
|
|
|
|
- compress
|
|
|
|
- delaycompress
|
|
|
|
- notifempty
|
|
|
|
- sharedscripts
|