Skip to content

Improve formatting #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

- [ ] 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 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`)
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ENHANCEMENTS:

* 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.
* 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:
* Add support for unix upstreams.
* Add PID templating option.
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,15 @@ Debian:
versions:
- jessie
- stretch
Ubuntu:
versions:
- xenial
- bionic
RedHat:
versions:
- 6
- 7
Ubuntu:
versions:
- xenial
- bionic
- focal
```

**NGINX Unit**
Expand Down
1 change: 0 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

- name: "(Install/Config: All OSs) Install and Configure NGINX"
block:

- name: "(Install: All OSs) Install NGINX"
block:
- name: "(Install: All OSs) Install NGINX Open Source"
Expand Down
4 changes: 2 additions & 2 deletions tasks/opensource/install-oss-bsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
- name: "(Install: OpenBSD) Install NGINX Package"
openbsd_pkg:
name: "nginx{{ nginx_version | default('') }}"
build: false
build: no
state: "{{ nginx_state }}"
when: nginx_bsd_install_packages
notify: "(Handler: All OSs) Start NGINX"

- name: "(Install: OpenBSD) Install NGINX Port"
openbsd_pkg:
name: "nginx{{ nginx_version | default('') }}"
build: true
build: yes
state: "{{ nginx_state }}"
when: not nginx_bsd_install_packages
notify: "(Handler: All OSs) Start NGINX"
Expand Down
2 changes: 1 addition & 1 deletion tasks/opensource/setup-redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- name: "(Install: CentOS/RedHat) Add NGINX Repository for CentOS/RHEL 8"
blockinfile:
path: /etc/yum.repos.d/nginx.repo
create: true
create: yes
block: |
[nginx]
baseurl = {{ repository }}
Expand Down
28 changes: 14 additions & 14 deletions tasks/opensource/setup-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- python3
- python3-pip
- python3-devel
update_cache: true
update_cache: yes
when: ansible_os_family == "RedHat"

- name: "(Install: Centos/RHEL) Set Python3 Default"
Expand All @@ -32,7 +32,7 @@
- wget
- ca-certificates
- zlib-devel
update_cache: true
update_cache: yes
when: ansible_os_family == "RedHat"

- name: "(Install: Debian) Install Backports Repo For Buster"
Expand All @@ -50,7 +50,7 @@
- checkinstall
- zlib1g-dev
- libtemplate-perl
update_cache: true
update_cache: yes
when: ansible_os_family == "Debian"

- name: "(Install: Alpine) Install Build Tools"
Expand All @@ -65,7 +65,7 @@
- linux-headers
- tar
- openrc
update_cache: true
update_cache: yes
when: ansible_os_family == "Alpine"

- name: "(Install: Alpine) Enable OpenRC"
Expand Down Expand Up @@ -98,23 +98,23 @@
- name: "(Install: Centos/RHEL) Install PCRE Dependency From Package"
yum:
name: pcre-devel
update_cache: true
update_cache: yes
when:
- nginx_install_source_pcre
- ansible_os_family == "RedHat"

- name: "(Install: Debian/Ubuntu) Install PCRE Dependency From Package"
apt:
name: libpcre3-dev
update_cache: true
update_cache: yes
when:
- nginx_install_source_pcre
- ansible_os_family == "Debian"

- name: "(Install: Alpine) Install PCRE Dependency From Package"
apk:
name: pcre-dev
update_cache: true
update_cache: yes
when:
- nginx_install_source_pcre
- ansible_os_family == "Alpine"
Expand Down Expand Up @@ -155,7 +155,7 @@
- name: "(Install: Centos/RHEL) Install ZLib Dependency From Package"
yum:
name: zlib-devel
update_cache: true
update_cache: yes
when:
- nginx_install_source_zlib
- ansible_os_family == "RedHat"
Expand All @@ -171,7 +171,7 @@
- name: "(Install: Alpine) Install ZLib Dependency From Package"
apk:
name: zlib-dev
update_cache: true
update_cache: yes
when:
- nginx_install_source_zlib
- ansible_os_family == "Alpine"
Expand Down Expand Up @@ -212,23 +212,23 @@
- name: "(Install: Centos/RHEL) Install OpenSSL Dependency From Package"
yum:
name: openssl-devel
update_cache: true
update_cache: yes
when:
- nginx_install_source_openssl
- ansible_os_family == "RedHat"

- name: "(Install: Debian/Ubuntu) Install OpenSSL Dependency From Package"
apt:
name: libssl-dev
update_cache: true
update_cache: yes
when:
- nginx_install_source_openssl
- ansible_os_family == "Debian"

- name: "(Install: Alpine) Install OpenSSL Dependency From Package"
apk:
name: openssl-dev
update_cache: true
update_cache: yes
when:
- nginx_install_source_openssl
- ansible_os_family == "Alpine"
Expand Down Expand Up @@ -271,7 +271,7 @@
- name: "(Install: Linux) Fetch NGINX Version"
uri:
url: https://trac.nginx.org/nginx/browser
return_content: true
return_content: yes
register: nginx_versions

- name: "(Install: Linux) Set NGINX Mainline Version"
Expand All @@ -296,7 +296,7 @@
- name: "(Install: Linux) Check For NGINX Install"
stat:
path: /usr/sbin/nginx
follow: true
follow: yes
register: nginx_result

- name: "(Install: Linux) Add NGINX User"
Expand Down
11 changes: 5 additions & 6 deletions tasks/plus/delete-license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
when: ansible_distribution == "Alpine"

- include_tasks: "{{ role_path }}/tasks/plus/setup-{{ ansible_os_family | lower }}.yml"
when:
- ansible_os_family == "Alpine"
or ansible_os_family == "FreeBSD"
or ansible_os_family == "Debian"
or ansible_os_family == "RedHat"
or ansible_os_family == "Suse"
when: ansible_os_family == "Alpine"
or ansible_os_family == "FreeBSD"
or ansible_os_family == "Debian"
or ansible_os_family == "RedHat"
or ansible_os_family == "Suse"
9 changes: 4 additions & 5 deletions tasks/plus/install-plus-linux.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
- include_tasks: "{{ role_path }}/tasks/plus/setup-{{ ansible_os_family | lower }}.yml"
when:
- ansible_os_family == "Alpine"
or ansible_os_family == "Debian"
or ansible_os_family == "RedHat"
or ansible_os_family == "Suse"
when: ansible_os_family == "Alpine"
or ansible_os_family == "Debian"
or ansible_os_family == "RedHat"
or ansible_os_family == "Suse"

- name: "(Install: Linux) Modify Service for Systemd"
include_tasks: "{{ role_path }}/tasks/prerequisites/setup-systemd.yml"
Expand Down
4 changes: 0 additions & 4 deletions tasks/plus/setup-license.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
- name: "(Setup: All OSs Besides Alpine Linux) Setup NGINX Plus License"
block:

- name: "(Setup: All OSs Besides Alpine Linux) Create SSL Directory"
file:
path: /etc/ssl/nginx
Expand All @@ -15,12 +14,10 @@
loop:
- "{{ nginx_license.certificate }}"
- "{{ nginx_license.key }}"

when: ansible_distribution != "Alpine"

- name: "(Setup: Alpine Linux) Setup NGINX Plus License"
block:

- name: "(Setup: Alpine Linux) Create APK Directory"
file:
path: /etc/apk
Expand All @@ -37,5 +34,4 @@
src: "{{ nginx_license.certificate }}"
dest: /etc/apk/cert.pem
decrypt: yes

when: ansible_distribution == "Alpine"
2 changes: 1 addition & 1 deletion tasks/prerequisites/setup-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
- apt-transport-https
- dirmngr
- python-apt
update_cache: true
update_cache: yes