-
Notifications
You must be signed in to change notification settings - Fork 353
/
converge.yml
62 lines (62 loc) · 2.39 KB
/
converge.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
- name: Converge
hosts: all
pre_tasks:
- name: Set repo if Alpine
ansible.builtin.set_fact:
ngx_version: =1.27.2-r1
njs_version: =1.27.2.0.8.6-r1
cacheable: true
when: ansible_facts['os_family'] == "Alpine"
- name: Set repo if Debian
ansible.builtin.set_fact:
ngx_version: =1.27.2-1~{{ ansible_facts['distribution_release'] }}
njs_version: =1.27.2+0.8.6-1~{{ ansible_facts['distribution_release'] }}
cacheable: true
when: ansible_facts['os_family'] == "Debian"
- name: Set repo if Red Hat
ansible.builtin.set_fact:
ngx_version: -1.27.2-1.{{ (ansible_facts['distribution'] == "Amazon") | ternary(('amzn' + ansible_facts['distribution_major_version'] | string), ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx
njs_version: -1.27.2+0.8.6-1.{{ (ansible_facts['distribution'] == "Amazon") | ternary(('amzn' + ansible_facts['distribution_major_version'] | string), ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx
cacheable: true
when: ansible_facts['os_family'] == "RedHat"
- name: Set repo if SLES
ansible.builtin.set_fact:
ngx_version: =1.27.2-1.sles{{ ansible_facts['distribution_major_version'] }}.ngx
njs_version: =1.27.2+0.8.6-1.sles{{ ansible_facts['distribution_major_version'] }}.ngx
cacheable: true
when: ansible_facts['os_family'] == "Suse"
tasks:
- name: Install NGINX
ansible.builtin.include_role:
name: ansible-role-nginx
vars:
nginx_version: "{{ ngx_version }}"
nginx_modules:
- name: brotli
version: "{{ ngx_version }}"
- name: geoip
version: "{{ ngx_version }}"
- name: image-filter
version: "{{ ngx_version }}"
- name: njs
state: present
version: "{{ njs_version }}"
- name: perl
version: "{{ ngx_version }}"
- name: xslt
version: "{{ ngx_version }}"
nginx_service_modify: true
nginx_service_timeout: 95
nginx_logrotate_conf_enable: true
nginx_logrotate_conf:
paths:
- /var/log/nginx/*.log
options:
- daily
- missingok
- rotate 14
- compress
- delaycompress
- notifempty
- sharedscripts