Initial
This commit is contained in:
16
roles/nginxinc.nginx_unit/tasks/unit/install-modules.yml
Normal file
16
roles/nginxinc.nginx_unit/tasks/unit/install-modules.yml
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
- name: (Amazon Linux/CentOS/Debian/RedHat/Ubuntu) Install NGINX Unit modules
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
loop: "{{ nginx_unit_modules }}"
|
||||
when: ansible_facts['os_family'] != "FreeBSD"
|
||||
notify: (Handler - Amazon Linux/CentOS/Debian/RedHat/Ubuntu) Start NGINX Unit
|
||||
|
||||
- name: (FreeBSD) Install NGINX Unit modules
|
||||
portinstall:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
loop: "{{ nginx_unit_modules }}"
|
||||
when: ansible_facts['os_family'] == "FreeBSD"
|
||||
notify: (Handler - FreeBSD) Start NGINX Unit
|
22
roles/nginxinc.nginx_unit/tasks/unit/install-unit.yml
Normal file
22
roles/nginxinc.nginx_unit/tasks/unit/install-unit.yml
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
- name: Configure NGINX Unit repository
|
||||
include_tasks: "{{ role_path }}/tasks/unit/setup-{{ ansible_facts['os_family'] | lower }}.yml"
|
||||
when: ansible_facts['os_family'] in ['Debian', 'FreeBSD', 'RedHat']
|
||||
|
||||
- name: (Amazon Linux/CentOS/Debian/RedHat/Ubuntu) Install NGINX Unit
|
||||
package:
|
||||
name: unit
|
||||
state: present
|
||||
when: ansible_facts['os_family'] != "FreeBSD"
|
||||
notify: (Handler - Amazon Linux/CentOS/Debian/RedHat/Ubuntu) Start NGINX Unit
|
||||
|
||||
- name: (FreeBSD) Install NGINX Unit
|
||||
portinstall:
|
||||
name: unit
|
||||
state: present
|
||||
when: ansible_facts['os_family'] == "FreeBSD"
|
||||
notify: (Handler - FreeBSD) Start NGINX Unit
|
||||
|
||||
- name: Install NGINX Unit modules
|
||||
include_tasks: "{{ role_path }}/tasks/unit/install-modules.yml"
|
||||
when: nginx_unit_modules is defined
|
10
roles/nginxinc.nginx_unit/tasks/unit/setup-debian.yml
Normal file
10
roles/nginxinc.nginx_unit/tasks/unit/setup-debian.yml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: "(Debian/Ubuntu) Add NGINX Unit repository"
|
||||
apt_repository:
|
||||
filename: nginx-unit
|
||||
repo: "{{ item }}"
|
||||
update_cache: yes
|
||||
mode: 0644
|
||||
loop:
|
||||
- deb [arch=amd64] https://packages.nginx.org/unit/{{ ansible_facts['distribution'] | lower }}/ {{ ansible_facts['distribution_release'] }} unit
|
||||
- deb-src https://packages.nginx.org/unit/{{ ansible_facts['distribution'] | lower }}/ {{ ansible_facts['distribution_release'] }} unit
|
10
roles/nginxinc.nginx_unit/tasks/unit/setup-freebsd.yml
Normal file
10
roles/nginxinc.nginx_unit/tasks/unit/setup-freebsd.yml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: (FreeBSD) fetch ports
|
||||
command: portsnap fetch --interactive
|
||||
args:
|
||||
creates: /var/db/portsnap/INDEX
|
||||
|
||||
- name: (FreeBSD) Extract ports
|
||||
command: portsnap extract
|
||||
args:
|
||||
creates: /usr/ports
|
21
roles/nginxinc.nginx_unit/tasks/unit/setup-redhat.yml
Normal file
21
roles/nginxinc.nginx_unit/tasks/unit/setup-redhat.yml
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
- name: (CentOS/RHEL) Add NGINX Unit repository
|
||||
yum_repository:
|
||||
name: nginx-unit
|
||||
baseurl: "https://packages.nginx.org/unit/{{ (ansible_facts['distribution'] == 'RedHat') | ternary('rhel/', 'centos/') }}$releasever/$basearch/"
|
||||
description: NGINX Unit Repository
|
||||
enabled: yes
|
||||
gpgcheck: yes
|
||||
mode: 0644
|
||||
when: ansible_facts['distribution'] != "Amazon"
|
||||
|
||||
- name: (Amazon Linux) Add NGINX Unit repository
|
||||
yum_repository:
|
||||
name: nginx-unit
|
||||
baseurl: "https://packages.nginx.org/unit/amzn\
|
||||
{{ (ansible_facts['distribution_major_version'] is version('2', '==')) | ternary('2', '') }}/$releasever/$basearch/"
|
||||
description: NGINX Unit Repository
|
||||
enabled: yes
|
||||
gpgcheck: yes
|
||||
mode: 0644
|
||||
when: ansible_facts['distribution'] == "Amazon"
|
Reference in New Issue
Block a user