Improve formatting (#293)
This commit is contained in:
parent
c85368e591
commit
fc4640bd4a
4
.github/pull_request_template.md
vendored
4
.github/pull_request_template.md
vendored
@ -5,6 +5,6 @@ Describe the use case and detail of the change. If this PR addresses an issue on
|
|||||||
Before creating a PR, run through this checklist and mark each as complete.
|
Before creating a PR, run through this checklist and mark each as complete.
|
||||||
|
|
||||||
- [ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/ansible-role-nginx/blob/master/CONTRIBUTING.md) document
|
- [ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/ansible-role-nginx/blob/master/CONTRIBUTING.md) document
|
||||||
- [ ] If necessary, I have added Molecule tests that prove my fix is effective or that my feature works
|
- [ ] I have added Molecule tests that prove my fix is effective or that my feature works
|
||||||
- [ ] I have checked that all Molecule tests pass after adding my changes
|
- [ ] I have checked that all Molecule tests pass after adding my changes
|
||||||
- [ ] I have updated any necessary documentation (`defaults/main/*.yml`, `README.md` and `CHANGELOG.md`)
|
- [ ] I have updated any relevant documentation (`defaults/main/*.yml`, `README.md` and `CHANGELOG.md`)
|
||||||
|
@ -39,6 +39,7 @@ ENHANCEMENTS:
|
|||||||
|
|
||||||
* Molecule tests using Testinfra have been migrated to use Ansible instead.
|
* Molecule tests using Testinfra have been migrated to use Ansible instead.
|
||||||
* The role now uses `include_tasks` instead of `import_tasks` when possible to speed up the role's execution time.
|
* The role now uses `include_tasks` instead of `import_tasks` when possible to speed up the role's execution time.
|
||||||
|
* Improve configuration cleanup capabilities. You can now remove all `*.conf` files in a given directory, or specify a list of files you wish to delete.
|
||||||
* Improve configuration templating capabilities:
|
* Improve configuration templating capabilities:
|
||||||
* Add support for unix upstreams.
|
* Add support for unix upstreams.
|
||||||
* Add PID templating option.
|
* Add PID templating option.
|
||||||
|
@ -137,14 +137,15 @@ Debian:
|
|||||||
versions:
|
versions:
|
||||||
- jessie
|
- jessie
|
||||||
- stretch
|
- stretch
|
||||||
Ubuntu:
|
|
||||||
versions:
|
|
||||||
- xenial
|
|
||||||
- bionic
|
|
||||||
RedHat:
|
RedHat:
|
||||||
versions:
|
versions:
|
||||||
- 6
|
- 6
|
||||||
- 7
|
- 7
|
||||||
|
Ubuntu:
|
||||||
|
versions:
|
||||||
|
- xenial
|
||||||
|
- bionic
|
||||||
|
- focal
|
||||||
```
|
```
|
||||||
|
|
||||||
**NGINX Unit**
|
**NGINX Unit**
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
- name: "(Install/Config: All OSs) Install and Configure NGINX"
|
- name: "(Install/Config: All OSs) Install and Configure NGINX"
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: "(Install: All OSs) Install NGINX"
|
- name: "(Install: All OSs) Install NGINX"
|
||||||
block:
|
block:
|
||||||
- name: "(Install: All OSs) Install NGINX Open Source"
|
- name: "(Install: All OSs) Install NGINX Open Source"
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
- name: "(Install: OpenBSD) Install NGINX Package"
|
- name: "(Install: OpenBSD) Install NGINX Package"
|
||||||
openbsd_pkg:
|
openbsd_pkg:
|
||||||
name: "nginx{{ nginx_version | default('') }}"
|
name: "nginx{{ nginx_version | default('') }}"
|
||||||
build: false
|
build: no
|
||||||
state: "{{ nginx_state }}"
|
state: "{{ nginx_state }}"
|
||||||
when: nginx_bsd_install_packages
|
when: nginx_bsd_install_packages
|
||||||
notify: "(Handler: All OSs) Start NGINX"
|
notify: "(Handler: All OSs) Start NGINX"
|
||||||
@ -45,7 +45,7 @@
|
|||||||
- name: "(Install: OpenBSD) Install NGINX Port"
|
- name: "(Install: OpenBSD) Install NGINX Port"
|
||||||
openbsd_pkg:
|
openbsd_pkg:
|
||||||
name: "nginx{{ nginx_version | default('') }}"
|
name: "nginx{{ nginx_version | default('') }}"
|
||||||
build: true
|
build: yes
|
||||||
state: "{{ nginx_state }}"
|
state: "{{ nginx_state }}"
|
||||||
when: not nginx_bsd_install_packages
|
when: not nginx_bsd_install_packages
|
||||||
notify: "(Handler: All OSs) Start NGINX"
|
notify: "(Handler: All OSs) Start NGINX"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
- name: "(Install: CentOS/RedHat) Add NGINX Repository for CentOS/RHEL 8"
|
- name: "(Install: CentOS/RedHat) Add NGINX Repository for CentOS/RHEL 8"
|
||||||
blockinfile:
|
blockinfile:
|
||||||
path: /etc/yum.repos.d/nginx.repo
|
path: /etc/yum.repos.d/nginx.repo
|
||||||
create: true
|
create: yes
|
||||||
block: |
|
block: |
|
||||||
[nginx]
|
[nginx]
|
||||||
baseurl = {{ repository }}
|
baseurl = {{ repository }}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
- python3
|
- python3
|
||||||
- python3-pip
|
- python3-pip
|
||||||
- python3-devel
|
- python3-devel
|
||||||
update_cache: true
|
update_cache: yes
|
||||||
when: ansible_os_family == "RedHat"
|
when: ansible_os_family == "RedHat"
|
||||||
|
|
||||||
- name: "(Install: Centos/RHEL) Set Python3 Default"
|
- name: "(Install: Centos/RHEL) Set Python3 Default"
|
||||||
@ -32,7 +32,7 @@
|
|||||||
- wget
|
- wget
|
||||||
- ca-certificates
|
- ca-certificates
|
||||||
- zlib-devel
|
- zlib-devel
|
||||||
update_cache: true
|
update_cache: yes
|
||||||
when: ansible_os_family == "RedHat"
|
when: ansible_os_family == "RedHat"
|
||||||
|
|
||||||
- name: "(Install: Debian) Install Backports Repo For Buster"
|
- name: "(Install: Debian) Install Backports Repo For Buster"
|
||||||
@ -50,7 +50,7 @@
|
|||||||
- checkinstall
|
- checkinstall
|
||||||
- zlib1g-dev
|
- zlib1g-dev
|
||||||
- libtemplate-perl
|
- libtemplate-perl
|
||||||
update_cache: true
|
update_cache: yes
|
||||||
when: ansible_os_family == "Debian"
|
when: ansible_os_family == "Debian"
|
||||||
|
|
||||||
- name: "(Install: Alpine) Install Build Tools"
|
- name: "(Install: Alpine) Install Build Tools"
|
||||||
@ -65,7 +65,7 @@
|
|||||||
- linux-headers
|
- linux-headers
|
||||||
- tar
|
- tar
|
||||||
- openrc
|
- openrc
|
||||||
update_cache: true
|
update_cache: yes
|
||||||
when: ansible_os_family == "Alpine"
|
when: ansible_os_family == "Alpine"
|
||||||
|
|
||||||
- name: "(Install: Alpine) Enable OpenRC"
|
- name: "(Install: Alpine) Enable OpenRC"
|
||||||
@ -98,7 +98,7 @@
|
|||||||
- name: "(Install: Centos/RHEL) Install PCRE Dependency From Package"
|
- name: "(Install: Centos/RHEL) Install PCRE Dependency From Package"
|
||||||
yum:
|
yum:
|
||||||
name: pcre-devel
|
name: pcre-devel
|
||||||
update_cache: true
|
update_cache: yes
|
||||||
when:
|
when:
|
||||||
- nginx_install_source_pcre
|
- nginx_install_source_pcre
|
||||||
- ansible_os_family == "RedHat"
|
- ansible_os_family == "RedHat"
|
||||||
@ -106,7 +106,7 @@
|
|||||||
- name: "(Install: Debian/Ubuntu) Install PCRE Dependency From Package"
|
- name: "(Install: Debian/Ubuntu) Install PCRE Dependency From Package"
|
||||||
apt:
|
apt:
|
||||||
name: libpcre3-dev
|
name: libpcre3-dev
|
||||||
update_cache: true
|
update_cache: yes
|
||||||
when:
|
when:
|
||||||
- nginx_install_source_pcre
|
- nginx_install_source_pcre
|
||||||
- ansible_os_family == "Debian"
|
- ansible_os_family == "Debian"
|
||||||
@ -114,7 +114,7 @@
|
|||||||
- name: "(Install: Alpine) Install PCRE Dependency From Package"
|
- name: "(Install: Alpine) Install PCRE Dependency From Package"
|
||||||
apk:
|
apk:
|
||||||
name: pcre-dev
|
name: pcre-dev
|
||||||
update_cache: true
|
update_cache: yes
|
||||||
when:
|
when:
|
||||||
- nginx_install_source_pcre
|
- nginx_install_source_pcre
|
||||||
- ansible_os_family == "Alpine"
|
- ansible_os_family == "Alpine"
|
||||||
@ -155,7 +155,7 @@
|
|||||||
- name: "(Install: Centos/RHEL) Install ZLib Dependency From Package"
|
- name: "(Install: Centos/RHEL) Install ZLib Dependency From Package"
|
||||||
yum:
|
yum:
|
||||||
name: zlib-devel
|
name: zlib-devel
|
||||||
update_cache: true
|
update_cache: yes
|
||||||
when:
|
when:
|
||||||
- nginx_install_source_zlib
|
- nginx_install_source_zlib
|
||||||
- ansible_os_family == "RedHat"
|
- ansible_os_family == "RedHat"
|
||||||
@ -171,7 +171,7 @@
|
|||||||
- name: "(Install: Alpine) Install ZLib Dependency From Package"
|
- name: "(Install: Alpine) Install ZLib Dependency From Package"
|
||||||
apk:
|
apk:
|
||||||
name: zlib-dev
|
name: zlib-dev
|
||||||
update_cache: true
|
update_cache: yes
|
||||||
when:
|
when:
|
||||||
- nginx_install_source_zlib
|
- nginx_install_source_zlib
|
||||||
- ansible_os_family == "Alpine"
|
- ansible_os_family == "Alpine"
|
||||||
@ -212,7 +212,7 @@
|
|||||||
- name: "(Install: Centos/RHEL) Install OpenSSL Dependency From Package"
|
- name: "(Install: Centos/RHEL) Install OpenSSL Dependency From Package"
|
||||||
yum:
|
yum:
|
||||||
name: openssl-devel
|
name: openssl-devel
|
||||||
update_cache: true
|
update_cache: yes
|
||||||
when:
|
when:
|
||||||
- nginx_install_source_openssl
|
- nginx_install_source_openssl
|
||||||
- ansible_os_family == "RedHat"
|
- ansible_os_family == "RedHat"
|
||||||
@ -220,7 +220,7 @@
|
|||||||
- name: "(Install: Debian/Ubuntu) Install OpenSSL Dependency From Package"
|
- name: "(Install: Debian/Ubuntu) Install OpenSSL Dependency From Package"
|
||||||
apt:
|
apt:
|
||||||
name: libssl-dev
|
name: libssl-dev
|
||||||
update_cache: true
|
update_cache: yes
|
||||||
when:
|
when:
|
||||||
- nginx_install_source_openssl
|
- nginx_install_source_openssl
|
||||||
- ansible_os_family == "Debian"
|
- ansible_os_family == "Debian"
|
||||||
@ -228,7 +228,7 @@
|
|||||||
- name: "(Install: Alpine) Install OpenSSL Dependency From Package"
|
- name: "(Install: Alpine) Install OpenSSL Dependency From Package"
|
||||||
apk:
|
apk:
|
||||||
name: openssl-dev
|
name: openssl-dev
|
||||||
update_cache: true
|
update_cache: yes
|
||||||
when:
|
when:
|
||||||
- nginx_install_source_openssl
|
- nginx_install_source_openssl
|
||||||
- ansible_os_family == "Alpine"
|
- ansible_os_family == "Alpine"
|
||||||
@ -271,7 +271,7 @@
|
|||||||
- name: "(Install: Linux) Fetch NGINX Version"
|
- name: "(Install: Linux) Fetch NGINX Version"
|
||||||
uri:
|
uri:
|
||||||
url: https://trac.nginx.org/nginx/browser
|
url: https://trac.nginx.org/nginx/browser
|
||||||
return_content: true
|
return_content: yes
|
||||||
register: nginx_versions
|
register: nginx_versions
|
||||||
|
|
||||||
- name: "(Install: Linux) Set NGINX Mainline Version"
|
- name: "(Install: Linux) Set NGINX Mainline Version"
|
||||||
@ -296,7 +296,7 @@
|
|||||||
- name: "(Install: Linux) Check For NGINX Install"
|
- name: "(Install: Linux) Check For NGINX Install"
|
||||||
stat:
|
stat:
|
||||||
path: /usr/sbin/nginx
|
path: /usr/sbin/nginx
|
||||||
follow: true
|
follow: yes
|
||||||
register: nginx_result
|
register: nginx_result
|
||||||
|
|
||||||
- name: "(Install: Linux) Add NGINX User"
|
- name: "(Install: Linux) Add NGINX User"
|
||||||
|
@ -19,9 +19,8 @@
|
|||||||
when: ansible_distribution == "Alpine"
|
when: ansible_distribution == "Alpine"
|
||||||
|
|
||||||
- include_tasks: "{{ role_path }}/tasks/plus/setup-{{ ansible_os_family | lower }}.yml"
|
- include_tasks: "{{ role_path }}/tasks/plus/setup-{{ ansible_os_family | lower }}.yml"
|
||||||
when:
|
when: ansible_os_family == "Alpine"
|
||||||
- ansible_os_family == "Alpine"
|
or ansible_os_family == "FreeBSD"
|
||||||
or ansible_os_family == "FreeBSD"
|
or ansible_os_family == "Debian"
|
||||||
or ansible_os_family == "Debian"
|
or ansible_os_family == "RedHat"
|
||||||
or ansible_os_family == "RedHat"
|
or ansible_os_family == "Suse"
|
||||||
or ansible_os_family == "Suse"
|
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
---
|
---
|
||||||
- include_tasks: "{{ role_path }}/tasks/plus/setup-{{ ansible_os_family | lower }}.yml"
|
- include_tasks: "{{ role_path }}/tasks/plus/setup-{{ ansible_os_family | lower }}.yml"
|
||||||
when:
|
when: ansible_os_family == "Alpine"
|
||||||
- ansible_os_family == "Alpine"
|
or ansible_os_family == "Debian"
|
||||||
or ansible_os_family == "Debian"
|
or ansible_os_family == "RedHat"
|
||||||
or ansible_os_family == "RedHat"
|
or ansible_os_family == "Suse"
|
||||||
or ansible_os_family == "Suse"
|
|
||||||
|
|
||||||
- name: "(Install: Linux) Modify Service for Systemd"
|
- name: "(Install: Linux) Modify Service for Systemd"
|
||||||
include_tasks: "{{ role_path }}/tasks/prerequisites/setup-systemd.yml"
|
include_tasks: "{{ role_path }}/tasks/prerequisites/setup-systemd.yml"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: "(Setup: All OSs Besides Alpine Linux) Setup NGINX Plus License"
|
- name: "(Setup: All OSs Besides Alpine Linux) Setup NGINX Plus License"
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: "(Setup: All OSs Besides Alpine Linux) Create SSL Directory"
|
- name: "(Setup: All OSs Besides Alpine Linux) Create SSL Directory"
|
||||||
file:
|
file:
|
||||||
path: /etc/ssl/nginx
|
path: /etc/ssl/nginx
|
||||||
@ -15,12 +14,10 @@
|
|||||||
loop:
|
loop:
|
||||||
- "{{ nginx_license.certificate }}"
|
- "{{ nginx_license.certificate }}"
|
||||||
- "{{ nginx_license.key }}"
|
- "{{ nginx_license.key }}"
|
||||||
|
|
||||||
when: ansible_distribution != "Alpine"
|
when: ansible_distribution != "Alpine"
|
||||||
|
|
||||||
- name: "(Setup: Alpine Linux) Setup NGINX Plus License"
|
- name: "(Setup: Alpine Linux) Setup NGINX Plus License"
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: "(Setup: Alpine Linux) Create APK Directory"
|
- name: "(Setup: Alpine Linux) Create APK Directory"
|
||||||
file:
|
file:
|
||||||
path: /etc/apk
|
path: /etc/apk
|
||||||
@ -37,5 +34,4 @@
|
|||||||
src: "{{ nginx_license.certificate }}"
|
src: "{{ nginx_license.certificate }}"
|
||||||
dest: /etc/apk/cert.pem
|
dest: /etc/apk/cert.pem
|
||||||
decrypt: yes
|
decrypt: yes
|
||||||
|
|
||||||
when: ansible_distribution == "Alpine"
|
when: ansible_distribution == "Alpine"
|
||||||
|
@ -5,4 +5,4 @@
|
|||||||
- apt-transport-https
|
- apt-transport-https
|
||||||
- dirmngr
|
- dirmngr
|
||||||
- python-apt
|
- python-apt
|
||||||
update_cache: true
|
update_cache: yes
|
||||||
|
Loading…
Reference in New Issue
Block a user