ansible-role-nginx/molecule/default/converge.yml

41 lines
1.3 KiB
YAML

---
- name: Converge
hosts: all
pre_tasks:
- name: Set repo if Alpine
ansible.builtin.set_fact:
version: "=1.21.5-r1"
when: ansible_facts['os_family'] == "Alpine"
- name: Set repo if Debian
ansible.builtin.set_fact:
version: "=1.21.5-1~{{ ansible_facts['distribution_release'] }}"
when: ansible_facts['os_family'] == "Debian"
- name: Set repo if Red Hat
ansible.builtin.set_fact:
version: "-1.21.5-1.{{ (ansible_facts['distribution'] == 'Amazon') | ternary('amzn2', ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx"
when: ansible_facts['os_family'] == "RedHat"
tasks:
- name: Install NGINX
ansible.builtin.include_role:
name: ansible-role-nginx
vars:
nginx_version: "{{ version }}"
nginx_service_modify: true
nginx_service_timeout: 95
nginx_selinux: true
nginx_selinux_tcp_ports:
- 80
- 443
nginx_logrotate_conf_enable: true
nginx_logrotate_conf:
paths:
- /var/log/nginx/*.log
options:
- daily
- missingok
- rotate 14
- compress
- delaycompress
- notifempty
- sharedscripts