Remove NGINX Unit from role (#348)

This commit is contained in:
Alessandro Fael Garcia 2020-11-13 21:57:28 +01:00 committed by GitHub
parent 121312d346
commit a11e457816
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 36 additions and 328 deletions

View File

@ -54,15 +54,6 @@ jobs:
- name: (CentOS) Test config templates
env:
scenario: template_centos
- name: (Debian/Ubuntu) Install NGINX Unit
env:
scenario: unit
- name: (Alpine Linux) Install NGINX Unit
env:
scenario: unit_alpine
- name: (CentOS) Install NGINX Unit
env:
scenario: unit_centos
- name: (Debian/Ubuntu) Build from source
env:
scenario: source

View File

@ -1,10 +1,16 @@
# Changelog
## 0.18.0 (November 13, 2020)
BREAKING CHANGES:
**The NGINX Unit functionalities included in this role have been removed as of release 0.18.0.** There now is a separate role to install NGINX Unit available [here](https://github.com/nginxinc/ansible-role-nginx-unit). Any new issues or PRs related to NGINX Unit should be submitted in the new NGINX Unit repository. New issues or PRs related to NGINX Unit submitted in this repository will not be worked on.
## 0.17.4 (November 12, 2020)
ENHANCEMENTS:
* Implement a new syntax to specify modules to be installed. You can now use the following format if you want further fine grained control over how you install modules:
Implement a new syntax to specify modules to be installed. You can now use the following format if you want further fine grained control over how you install modules:
```yaml
- name: njs # Required
state: present # Optional
@ -34,7 +40,7 @@ BUG FIXES:
BUG FIXES:
* Fix an issue where sometimes the role handlers will fail in distros where NGINX is not started upon installation.
Fix an issue where sometimes the role handlers will fail in distros where NGINX is not started upon installation.
## 0.17.1 (September 22, 2020)
@ -81,7 +87,7 @@ BUG FIXES:
BREAKING CHANGES:
* The Debian and Ubuntu repositories have slightly changed. You may run into some duplication issues when running the role on a preexisting target that already has had NGINX installed using the role. To fix this, manually remove the old repository source.
The Debian and Ubuntu repositories have slightly changed. You may run into some duplication issues when running the role on a preexisting target that already has had NGINX installed using the role. To fix this, manually remove the old repository source.
ENHANCEMENTS:
@ -91,11 +97,11 @@ ENHANCEMENTS:
FEATURES:
* TravisCI now always uses the latest version of Docker.
TravisCI now always uses the latest version of Docker.
BUG FIXES:
* Building OpenSSL from source should now work properly in CentOS 8.
Building OpenSSL from source should now work properly in CentOS 8.
## 0.15.0 (August 20, 2020)
@ -162,7 +168,7 @@ This is a relatively minor release, but it includes a potential breaking change
BREAKING CHANGES:
* The NGINX Controller agent can no longer be installed using this role. Please use the Ansible collection linked in the README.
The NGINX Controller agent can no longer be installed using this role. Please use the Ansible collection linked in the README.
FEATURES:
@ -213,20 +219,20 @@ BUG FIXES:
FEATURES:
* Improve NGINX http templating - following parameters are now supported:
* Websockets.
* Basic authentication.
* Proxy cache.
* Proxy redirect.
* Proxy timeouts.
* SSL.
* Root (in server context).
* Add basic NGINX stream templating.
* Add support for RHEL 8 and Alpine Linux.
Improve NGINX http templating - following parameters are now supported:
* Websockets.
* Basic authentication.
* Proxy cache.
* Proxy redirect.
* Proxy timeouts.
* SSL.
* Root (in server context).
* Add basic NGINX stream templating.
* Add support for RHEL 8 and Alpine Linux.
BUG FIXES:
* Fix module installation tasks.
Fix module installation tasks.
## 0.11.0 (Januray 14, 2019)
@ -250,13 +256,13 @@ BUG FIXES:
BUG FIXES:
* Fix HTML template to use correct variable name.
Fix HTML template to use correct variable name.
## 0.10.0 (November 26, 2018)
FEATURES:
* Improve templating support for health checks, multiple location blocks, and auto indexing.
Improve templating support for health checks, multiple location blocks, and auto indexing.
BUG FIXES:
@ -281,13 +287,13 @@ FEATURES:
BUG FIXES:
* Correct spelling of name in `tasks/prerequisites/setup-debian.yml`.
Correct spelling of name in `tasks/prerequisites/setup-debian.yml`.
## 0.7.1 (August 21, 2018)
FEATURES:
* Add enabled parameter to NGINX and NGINX Unit handlers.
Add enabled parameter to NGINX and NGINX Unit handlers.
## 0.7.0 (August 4, 2018)
@ -313,7 +319,7 @@ FEATURES:
FEATURES:
* Add support for NGINX Unit.
Add support for NGINX Unit.
## 0.4.0 (May 25, 2018)
@ -326,17 +332,17 @@ FEATURES:
FEATURES:
* Improve Travis CI testing strategy.
Improve Travis CI testing strategy.
BUG FIXES:
* Fix templating and push tasks.
Fix templating and push tasks.
## 0.2.0 (April 12, 2018)
FEATURES:
* Add support for all first party NGINX modules.
Add support for all first party NGINX modules.
BUG FIXES:

View File

@ -26,7 +26,7 @@ Follow our [Installation Guide](https://github.com/nginxinc/ansible-role-nginx/b
### Project Structure
* The NGINX Ansible role is written in `yaml` and supports NGINX Open Source, NGINX Plus, NGINX Amplify, and NGINX Unit.
* The NGINX Ansible role is written in `yaml` and supports NGINX Open Source, NGINX Plus, and NGINX Amplify.
* The project follows the standard [Ansible role directory structure](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html):
* The main code is found in `tasks/`.
* Variables can be found in `defaults/main/*.yml`.

View File

@ -6,7 +6,7 @@
# Ansible NGINX Role
This role installs NGINX Open Source, NGINX Plus, the NGINX Amplify agent, or NGINX Unit on your target host.
This role installs NGINX Open Source, NGINX Plus, or the NGINX Amplify agent on your target host.
**Note:** This role is still in active development. There may be unidentified issues and the role variables may change as development continues.
@ -15,7 +15,7 @@ This role installs NGINX Open Source, NGINX Plus, the NGINX Amplify agent, or NG
With the advent of Ansible collections and the release of the [NGINX Core Ansible collection](https://github.com/nginxinc/ansible-collection-nginx), the decision has been made to split this role into three smaller roles and reduce the overhead of this role:
* The NGINX Ansible role will keep working as is and be used to install and setup NGINX.
* **The NGINX configuration functionalities included in this role will be removed in an upcoming release at some stage after December 1st 2020.** There now is a separate role to manage and create NGINX configurations available [here](https://github.com/nginxinc/ansible-role-nginx-config). Any new issues or PRs related to configuring NGINX should be submitted in the new NGINX Config repository. New issues or PRs related to configuring NGINX submitted in this repository will not be worked on.
* **The NGINX Unit functionalities included in this role will be removed in an upcoming release at some stage after November 1st 2020.** There now is a separate role to install NGINX Unit available [here](https://github.com/nginxinc/ansible-role-nginx-unit). Any new issues or PRs related to NGINX Unit should be submitted in the new NGINX Unit repository. New issues or PRs related to NGINX Unit submitted in this repository will not be worked on.
* **The NGINX Unit functionalities included in this role have been removed as of release 0.18.0.** There now is a separate role to install NGINX Unit available [here](https://github.com/nginxinc/ansible-role-nginx-unit). Any new issues or PRs related to NGINX Unit should be submitted in the new NGINX Unit repository. New issues or PRs related to NGINX Unit submitted in this repository will not be worked on. This disclaimer will be removed in a future release.
## Requirements
@ -41,7 +41,7 @@ Use `git clone https://github.com/nginxinc/ansible-role-nginx.git` to pull the l
## Platforms
The NGINX Ansible role supports all platforms supported by [NGINX Open Source](https://nginx.org/en/linux_packages.html), [NGINX Plus](https://docs.nginx.com/nginx/technical-specs/), the [NGINX Amplify agent](https://github.com/nginxinc/nginx-amplify-doc/blob/master/amplify-faq.md#21-what-operating-systems-are-supported), and [NGINX Unit](https://unit.nginx.org/installation/#official-packages):
The NGINX Ansible role supports all platforms supported by [NGINX Open Source](https://nginx.org/en/linux_packages.html), [NGINX Plus](https://docs.nginx.com/nginx/technical-specs/), and the [NGINX Amplify agent](https://github.com/nginxinc/nginx-amplify-doc/blob/master/amplify-faq.md#21-what-operating-systems-are-supported):
### NGINX Open Source
@ -130,30 +130,6 @@ Ubuntu:
- focal
```
### NGINX Unit
```yaml
Amazon Linux:
- 2018.03
Amazon Linux 2:
- any
CentOS:
- 6
- 7
- 8
Debian:
- stretch
- buster
Red Hat:
- 6
- 7
- 8
Ubuntu:
- xenial
- bionic
- focal
```
**Note:** You can also use this role to compile NGINX Open Source from source, install NGINX Open Source on compatible yet unsupported platforms, or install NGINX Open Source on BSD systems at your own risk.
## Role Variables
@ -168,7 +144,6 @@ This role has multiple variables. The descriptions and defaults for all these va
|**[`upload.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/upload.yml)**|NGINX configuration/HTML/SSL upload variables|
|**[`linux.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/linux.yml)**|Linux installation variables|
|**[`bsd.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/bsd.yml)**|BSD installation variables|
|**[`unit.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/unit.yml)**|NGINX Unit installation variables|
Similarly, descriptions and defaults for preset variables can be found in the **[`vars/`](https://github.com/nginxinc/ansible-role-nginx/blob/main/vars/)** folder in the following files:
@ -188,7 +163,6 @@ Working functional playbook examples can be found in the **[`molecule/common/pla
|**[`source_converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/common/playbooks/source_converge.yml)**|Install NGINX from source|
|**[`stable_push_converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/common/playbooks/stable_push_converge.yml)**|Install NGINX using the stable branch and push a preexisting config from your system to your NGINX instance|
|**[`template_converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/common/playbooks/template_converge.yml)**|Use the NGINX configuration templating variables to create an NGINX configuration file|
|**[`unit_converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/common/playbooks/unit_converge.yml)**|Install NGINX Unit|
Do note that if you install this repository via Ansible Galaxy, you will have to replace the role variable in the sample playbooks from `ansible-role-nginx` to `nginxinc.nginx`.

View File

@ -1,7 +0,0 @@
## DEPRECATED -- Use nginxinc.nginx_unit role instead (https://github.com/nginxinc/ansible-role-nginx-unit)
---
# Install NGINX Unit and NGINX Unit modules.
# Use a list of supported NGINX Unit modules.
# Default is false.
nginx_unit_enable: false
nginx_unit_modules: []

View File

@ -35,17 +35,5 @@
name: amplify-agent
state: started
- name: (DEPRECATED Handler - Debian/Ubuntu/CentOS/RedHat) Start NGINX Unit
service:
name: unit
state: started
enabled: yes
- name: (DEPRECATED Handler - FreeBSD) Start NGINX Unit
service:
name: unitd
state: started
enabled: yes
- name: (Handler) Run logrotate
command: logrotate -f /etc/logrotate.d/nginx

View File

@ -1,32 +0,0 @@
---
- name: Converge
hosts: all
pre_tasks:
- name: Set module if Alpine
set_fact:
module:
- unit-perl
- unit-php7
- unit-python3
when: ansible_facts['os_family'] == "Alpine"
- name: Set module if Debian
set_fact:
module:
- unit-perl
- unit-php
- unit-ruby
when: ansible_facts['os_family'] == "Debian"
- name: Set module if Red Hat
set_fact:
module:
- unit-php
- unit-go
when: ansible_facts['os_family'] == "RedHat"
tasks:
- name: Install NGINX Unit
include_role:
name: ansible-role-nginx
vars:
nginx_enable: false
nginx_unit_enable: true
nginx_unit_modules: "{{ module }}"

View File

@ -1,47 +0,0 @@
---
driver:
name: docker
lint: |
set -e
yamllint .
ansible-lint --force-color
platforms:
- name: debian-stretch
image: debian:stretch-slim
dockerfile: ../common/Dockerfile.j2
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: debian-buster
image: debian:buster-slim
dockerfile: ../common/Dockerfile.j2
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: ubuntu-xenial
image: ubuntu:xenial
dockerfile: ../common/Dockerfile.j2
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: ubuntu-bionic
image: ubuntu:bionic
dockerfile: ../common/Dockerfile.j2
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: ubuntu-focal
image: ubuntu:focal
dockerfile: ../common/Dockerfile.j2
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
provisioner:
name: ansible
playbooks:
converge: ../common/playbooks/unit_converge.yml

View File

@ -1,40 +0,0 @@
---
driver:
name: docker
lint: |
set -e
yamllint .
ansible-lint --force-color
platforms:
- name: alpine-3.9
image: alpine:3.9
dockerfile: ../common/Dockerfile.j2
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: alpine-3.10
image: alpine:3.10
dockerfile: ../common/Dockerfile.j2
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: alpine-3.11
image: alpine:3.11
dockerfile: ../common/Dockerfile.j2
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: alpine-3.12
image: alpine:3.12
dockerfile: ../common/Dockerfile.j2
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
provisioner:
name: ansible
playbooks:
converge: ../common/playbooks/unit_converge.yml

View File

@ -1,33 +0,0 @@
---
driver:
name: docker
lint: |
set -e
yamllint .
ansible-lint --force-color
platforms:
- name: centos-6
image: centos:6
dockerfile: ../common/Dockerfile.j2
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: centos-7
image: centos:7
dockerfile: ../common/Dockerfile.j2
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
- name: centos-8
image: centos:8
dockerfile: ../common/Dockerfile.j2
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
provisioner:
name: ansible
playbooks:
converge: ../common/playbooks/unit_converge.yml

View File

@ -18,7 +18,7 @@
- name: Set up signing keys
include_tasks: "{{ role_path }}/tasks/keys/setup-keys.yml"
when: (nginx_install | bool and nginx_install_from == "nginx_repository")
or nginx_amplify_enable | bool or nginx_unit_enable | bool
or nginx_amplify_enable | bool
tags: nginx_key
- name: Install and Configure NGINX
@ -111,8 +111,3 @@
- nginx_amplify_api_key is defined
- nginx_amplify_api_key | length > 0
tags: nginx_install_amplify
- name: (DEPRECATED) Install NGINX Unit
include_tasks: "{{ role_path }}/tasks/unit/install-unit.yml"
when: nginx_unit_enable | bool
tags: nginx_install_unit

View File

@ -1,17 +0,0 @@
## DEPRECATED -- Use nginxinc.nginx_unit role instead (https://github.com/nginxinc/ansible-role-nginx-unit)
---
- name: (Debian/Ubuntu/CentOS/RedHat) Install NGINX Unit Modules
package:
name: "{{ item }}"
state: present
loop: "{{ nginx_unit_modules }}"
when: ansible_facts['os_family'] != "FreeBSD"
notify: (DEPRECATED Handler - Debian/Ubuntu/CentOS/RedHat) 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: (DEPRECATED Handler - FreeBSD) Start NGINX Unit

View File

@ -1,29 +0,0 @@
## DEPRECATED -- Use nginxinc.nginx_unit role instead (https://github.com/nginxinc/ansible-role-nginx-unit)
---
- name: Deprecation warning
debug:
msg: DEPRECATED TASKS -- Use nginxinc.nginx_unit role instead (https://github.com/nginxinc/ansible-role-nginx-unit)
- name: (DEPRECATED) Configure NGINX Unit Repository
include_tasks: "{{ role_path }}/tasks/unit/setup-{{ ansible_facts['os_family'] | lower }}.yml"
when: ansible_facts['os_family'] == "Debian"
or ansible_facts['os_family'] == "RedHat"
or ansible_facts['os_family'] == "FreeBSD"
- name: (DEPRECATED) Install NGINX Unit
package:
name: unit
state: present
when: ansible_facts['os_family'] != "FreeBSD"
notify: (DEPRECATED Handler - Debian/Ubuntu/CentOS/RedHat) Start NGINX Unit
- name: (DEPRECATED) Install NGINX Unit
portinstall:
name: unit
state: present
when: ansible_facts['os_family'] == "FreeBSD"
notify: (DEPRECATED Handler - FreeBSD) Start NGINX Unit
- name: (DEPRECATED) Install NGINX Unit modules
include_tasks: "{{ role_path }}/tasks/unit/install-modules.yml"
when: nginx_unit_modules is defined

View File

@ -1,9 +0,0 @@
## DEPRECATED -- Use nginxinc.nginx_unit role instead (https://github.com/nginxinc/ansible-role-nginx-unit)
---
- name: (DEPRECATED) Add NGINX Unit Repository
apt_repository:
repo: "{{ item }}"
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

View File

@ -1,11 +0,0 @@
## DEPRECATED -- Use nginxinc.nginx_unit role instead (https://github.com/nginxinc/ansible-role-nginx-unit)
---
- name: (DEPRECATED) Fetch Ports
command: portsnap fetch --interactive
args:
creates: /var/db/portsnap/INDEX
- name: (DEPRECATED) Extract Ports
command: portsnap extract
args:
creates: /usr/ports

View File

@ -1,21 +0,0 @@
## DEPRECATED -- Use nginxinc.nginx_unit role instead (https://github.com/nginxinc/ansible-role-nginx-unit)
---
- name: (DEPRECATED) Add NGINX Unit Repository
yum_repository:
name: 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: (DEPRECATED) Add NGINX Unit Repository
yum_repository:
name: unit
baseurl: https://packages.nginx.org/unit/amzn{{ (ansible_facts['distribution_version'] == "2") | ternary('2', '') }}/$releasever/$basearch/
description: NGINX Unit Repository
enabled: yes
gpgcheck: yes
mode: 0644
when: ansible_facts['distribution'] == "Amazon"