2021-12-07 02:47:13 +01:00
|
|
|
---
|
|
|
|
- name: Prepare
|
|
|
|
hosts: all
|
|
|
|
pre_tasks:
|
|
|
|
- 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"
|
2021-12-07 02:47:13 +01:00
|
|
|
when: ansible_facts['os_family'] == "Alpine"
|
|
|
|
- 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'] }}"
|
2021-12-07 02:47:13 +01: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"
|
2021-12-07 02:47:13 +01:00
|
|
|
when: ansible_facts['os_family'] == "RedHat"
|
|
|
|
tasks:
|
|
|
|
- name: Install NGINX
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.include_role:
|
2021-12-07 02:47:13 +01:00
|
|
|
name: ansible-role-nginx
|
|
|
|
vars:
|
|
|
|
nginx_version: "{{ version }}"
|