Skip to content

Commit 17b5c87

Browse files
authored
Add basic assertions (#319)
1 parent 856a9c9 commit 17b5c87

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1049
-951
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Steps to reproduce the behavior:
2020
A clear and concise description of what you expected to happen.
2121

2222
**Your environment:**
23-
- Version of the NGINX Role or specific commit
23+
- Version of the NGINX role or specific commit
2424
- Version of Ansible
2525
- Target deployment platform
2626

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Describe the use case and detail of the change. If this PR addresses an issue on
44
### Checklist
55
Before creating a PR, run through this checklist and mark each as complete.
66

7-
- [ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/ansible-role-nginx/blob/master/CONTRIBUTING.md) document
7+
- [ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/ansible-role-nginx/blob/main/CONTRIBUTING.md) document
88
- [ ] I have added Molecule tests that prove my fix is effective or that my feature works
99
- [ ] I have checked that all Molecule tests pass after adding my changes
1010
- [ ] I have updated any relevant documentation (`defaults/main/*.yml`, `README.md` and `CHANGELOG.md`)

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
- name: "(Debian/Ubuntu) Install Specific Version"
77
env:
88
scenario: default
9-
- name: "(Alpine) Install Specific Version"
9+
- name: "(Alpine Linux) Install Specific Version"
1010
env:
1111
scenario: default_alpine
1212
- name: "(CentOS) Install Specific Version"
@@ -15,7 +15,7 @@ jobs:
1515
- name: "(Debian/Ubuntu) Install Modules"
1616
env:
1717
scenario: module
18-
- name: "(Alpine) Install Modules"
18+
- name: "(Alpine Linux) Install Modules"
1919
env:
2020
scenario: module_alpine
2121
- name: "(CentOS) Install Modules"
@@ -24,7 +24,7 @@ jobs:
2424
- name: "(Debian/Ubuntu) Install Stable Branch and Push Configuration"
2525
env:
2626
scenario: stable_push
27-
- name: "(Alpine) Install Stable Branch and Push Configuration"
27+
- name: "(Alpine Linux) Install Stable Branch and Push Configuration"
2828
env:
2929
scenario: stable_push_alpine
3030
- name: "(CentOS) Install Stable Branch and Push Configuration"
@@ -33,7 +33,7 @@ jobs:
3333
- name: "(Debian/Ubuntu) Use Template Setting"
3434
env:
3535
scenario: template
36-
- name: "(Alpine) Use Template Setting"
36+
- name: "(Alpine Linux) Use Template Setting"
3737
env:
3838
scenario: template_alpine
3939
- name: "(CentOS) Use Template Setting"
@@ -42,7 +42,7 @@ jobs:
4242
- name: "(Debian/Ubuntu) Install NGINX Unit"
4343
env:
4444
scenario: unit
45-
- name: "(Alpine) Install NGINX Unit"
45+
- name: "(Alpine Linux) Install NGINX Unit"
4646
env:
4747
scenario: unit_alpine
4848
- name: "(CentOS) Install NGINX Unit"
@@ -51,7 +51,7 @@ jobs:
5151
- name: "(Debian/Ubuntu) Install from Source"
5252
env:
5353
scenario: source
54-
- name: "(Alpine) Install from Source"
54+
- name: "(Alpine Linux) Install from Source"
5555
env:
5656
scenario: source_alpine
5757
- name: "(CentOS) Install from Source"

CHANGELOG.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,32 @@
44

55
BREAKING CHANGES:
66

7-
* The process to install modules has changed. You will now have to use a list variable, `nginx_modules`, instead of manually setting the modules you want to install to `true` or `false`. This change will also simplify adding future supported modules to this role. You can find a list of supported modules for NGINX and NGINX Plus in [`vars/main.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/master/vars/main.yml).
7+
* The process to install modules has changed. You will now have to use a list variable, `nginx_modules`, instead of manually setting the modules you want to install to `true` or `false`. This change will also simplify adding future supported modules to this role. You can find a list of supported modules for NGINX and NGINX Plus in [`vars/main.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/vars/main.yml).
88
* Modules can no longer be added to your NGINX config using this role. Please use the [`nginx_config`](https://github.com/nginxinc/ansible-role-nginx-config) role instead.
9+
* Changed `nginx_configure` default value from `true` to `false` to further promote the adoption of the [NGINX config](https://github.com/nginxinc/ansible-role-nginx-config) role.
910

1011
FEATURES:
1112

12-
* Add Alpine 3.12 to the list of supported platforms
13-
* Remove Alpine 3.8 from the list of supported platforms
13+
* Two new variables have been introduced:
14+
* `nginx_setup_license` -- Determine whether you want to use this role to upload your NGINX license to your target host.
15+
* `nginx_debug_tasks` -- Print task related information to give you a better insight into the current progress of the role.
16+
* The role will now fail automatically if you try to deploy NGINX from an official repository in an unsupported distribution. You can find a list of supported distributions for NGINX and NGINX Plus in [`vars/main.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/vars/main.yml)
17+
* Three new tags have been introduced -- `nginx_setup_license`, `nginx_install` and `nginx_check_support`.
18+
* Add Alpine 3.12 to the list of supported platforms.
19+
* Remove Alpine 3.8 from the list of supported platforms.
1420

1521
ENHANCEMENTS:
1622

23+
* Major backend refactoring to reduce the number of files and tasks.
24+
* You can now specify an `nginx_repository` for NGINX Plus too.
25+
* Moved "constant" variables to `vars/main.yml`.
26+
* Included deprecation warnings in task names and files.
27+
* Improved tasks naming conventions.
1728
* Update Ansible to `2.9.13` and Ansible Lint to `4.3.4`.
1829

1930
BUG FIXES:
2031

21-
* NGINX Plus repository data for RedHat based distros is now appropriately set.
32+
* NGINX Plus repository data for RHEL based distros is now appropriately set.
2233

2334
## 0.16.0 (August 28, 2020)
2435

@@ -47,7 +58,7 @@ DEPRECATION WARNING:
4758
With the advent of Ansible collections and to reduce the overhead of this role, the decision has been made to split this role into three smaller roles:
4859
* The NGINX Ansible role will keep working as is and be used to install and setup NGINX.
4960
* 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 configuration functionalities included in this role will be removed in an upcoming release.
50-
* NGINX Unit has a separate role 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 will be removed in an upcoming release.
61+
* NGINX Unit now has a separate role 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 will be removed in an upcoming release.
5162

5263
BREAKING CHANGES:
5364

CONTRIBUTING.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,26 @@ The following is a set of guidelines for contributing to the NGINX Ansible role.
1414
* [Git Guidelines](#git-guidelines)
1515
* [Ansible Guidelines](#ansible-guidelines)
1616

17-
[Code of Conduct](https://github.com/nginxinc/ansible-role-nginx/blob/master/CODE_OF_CONDUCT.md)
17+
[Code of Conduct](https://github.com/nginxinc/ansible-role-nginx/blob/main/CODE_OF_CONDUCT.md)
1818

1919
## Ask a Question
2020

21-
Don't know how something works? Curious if the role can achieve your desired functionality. Please open an Issue on GitHub with the label `question`.
21+
Don't know how something works? Curious if the role can achieve your desired functionality? Please open an Issue on GitHub with the label `question`.
2222

2323
## Getting Started
2424

25-
Follow our [Installation Guide](https://github.com/nginxinc/ansible-role-nginx/blob/master/README.md#Installation) to install Ansible and Molecule and get ready to use the NGINX Ansible role.
25+
Follow our [Installation Guide](https://github.com/nginxinc/ansible-role-nginx/blob/main/README.md#Installation) to install Ansible and Molecule and get ready to use the NGINX Ansible role.
2626

2727
### Project Structure
2828

2929
* The NGINX Ansible role is written in `yaml` and supports NGINX Open Source, NGINX Plus, NGINX Amplify, and NGINX Unit.
30-
* The project follows the standard [Ansible role directory structure](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html)
31-
* The main code is found in `tasks/`
32-
* The main variables can be found in `defaults/main/*.yml`
33-
* Configuration templates for NGINX can be found in `templates/`
30+
* The project follows the standard [Ansible role directory structure](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html):
31+
* The main code is found in `tasks/`.
32+
* Variables can be found in `defaults/main/*.yml`.
33+
* "Constant" variables can be found in `vars/main.yml`.
34+
* Configuration templates for NGINX can be found in `templates/`.
3435
* [Molecule](https://molecule.readthedocs.io/) tests can be found in `molecule/`.
35-
* CI/CD is done via Travis using `.travis.yml` deployment yaml files
36+
* CI/CD is done via Travis using `.travis.yml` deployment `yaml` files.
3637

3738
## Contributing
3839

@@ -46,8 +47,8 @@ To suggest an enhancement, please create an issue on GitHub with the label `enha
4647

4748
### Open a Pull Request
4849

49-
* Fork the repo, create a branch, submit a PR when your changes are **tested** (ideally using Molecule) and ready for review
50-
* Fill in [our pull request template](https://github.com/nginxinc/ansible-role-nginx/blob/master/.github/PULL_REQUEST_TEMPLATE.md)
50+
* Fork the repo, create a branch, submit a PR when your changes are **tested** (ideally using Molecule) and ready for review.
51+
* Fill in [our pull request template](https://github.com/nginxinc/ansible-role-nginx/blob/main/.github/PULL_REQUEST_TEMPLATE.md).
5152

5253
Note: if you’d like to implement a new feature, please consider creating a feature request issue first to start a discussion about the feature.
5354

@@ -63,10 +64,10 @@ Note: if you’d like to implement a new feature, please consider creating a fea
6364

6465
### Git Guidelines
6566

66-
* Keep a clean, concise and meaningful git commit history on your branch (within reason), rebasing locally and squashing before submitting a PR
67-
* Follow the guidelines of writing a good commit message as described here <https://chris.beams.io/posts/git-commit/> and summarised in the next few points
68-
* In the subject line, use the present tense ("Add feature" not "Added feature")
69-
* In the subject line, use the imperative mood ("Move cursor to..." not "Moves cursor to...")
70-
* Limit the subject line to 72 characters or less
71-
* Reference issues and pull requests liberally after the subject line
72-
* Add more detailed description in the body of the git message (`git commit -a` to give you more space and time in your text editor to write a good message instead of `git commit -am`)
67+
* Keep a clean, concise and meaningful git commit history on your branch (within reason), rebasing locally and squashing before submitting a PR.
68+
* Follow the guidelines of writing a good commit message as described here <https://chris.beams.io/posts/git-commit/> and summarised in the next few points:
69+
* In the subject line, use the present tense ("Add feature" not "Added feature").
70+
* In the subject line, use the imperative mood ("Move cursor to..." not "Moves cursor to...").
71+
* Limit the subject line to 72 characters or less.
72+
* Reference issues and pull requests liberally after the subject line.
73+
* Add more detailed description in the body of the git message (`git commit -a` to give you more space and time in your text editor to write a good message instead of `git commit -am`).

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ This role installs NGINX Open Source, NGINX Plus, the NGINX Amplify agent, or NG
1010

1111
**Deprecation Warnings:**
1212

13-
* 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 (with the exception of major bugfixes). The NGINX configuration functionalities included in this role will be removed in an upcoming release.
14-
* NGINX Unit now has a separate role 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 (with the exception of major bugfixes). The NGINX Unit functionalities included in this role will be removed in an upcoming release.
13+
With the advent of Ansible collections and to reduce the overhead of this role, the decision has been made to split this role into three smaller roles:
14+
* The NGINX Ansible role will keep working as is and be used to install and setup NGINX.
15+
* 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 configuration functionalities included in this role will be removed in an upcoming release.
16+
* NGINX Unit now has a separate role 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 will be removed in an upcoming release.
1517

1618
Requirements
1719
------------
@@ -42,7 +44,7 @@ Use `git clone https://github.com/nginxinc/ansible-role-nginx.git` to pull the l
4244
Platforms
4345
---------
4446

45-
The NGINX Ansible role supports all platforms supported by [NGINX Open Source](https://nginx.org/en/linux_packages.html#mainline), [NGINX Plus](https://www.nginx.com/products/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):
47+
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) (you can also use this role to compile NGINX Open Source from source or install it on BSD systems at your own risk):
4648

4749
**NGINX Open Source**
4850

@@ -54,15 +56,12 @@ Alpine:
5456
- 3.12
5557
CentOS:
5658
- 6
57-
- 7
59+
- 7.4+
5860
- 8
5961
Debian:
6062
- stretch
6163
- buster
62-
FreeBSD:
63-
- 11.2+
64-
- 12
65-
RedHat:
64+
Red Hat:
6665
- 6
6766
- 7.4+
6867
- 8
@@ -72,6 +71,7 @@ SUSE/SLES:
7271
Ubuntu:
7372
- xenial
7473
- bionic
74+
- eoan
7575
- focal
7676
```
7777
@@ -82,7 +82,6 @@ Alpine:
8282
- 3.9
8383
- 3.10
8484
- 3.11
85-
- 3.12
8685
Amazon Linux:
8786
- 2018.03
8887
Amazon Linux 2:
@@ -100,7 +99,7 @@ FreeBSD:
10099
Oracle Linux:
101100
- 6.5+
102101
- 7.4+
103-
RedHat:
102+
Red Hat:
104103
- 6.5+
105104
- 7.4+
106105
- 8
@@ -110,6 +109,7 @@ SUSE/SLES:
110109
Ubuntu:
111110
- xenial
112111
- bionic
112+
- eoan
113113
- focal
114114
```
115115
@@ -124,7 +124,7 @@ CentOS:
124124
Debian:
125125
- jessie
126126
- stretch
127-
RedHat:
127+
Red Hat:
128128
- 6
129129
- 7
130130
Ubuntu:
@@ -147,7 +147,7 @@ CentOS:
147147
Debian:
148148
- stretch
149149
- buster
150-
RedHat:
150+
Red Hat:
151151
- 6
152152
- 7
153153
- 8
@@ -160,7 +160,7 @@ Ubuntu:
160160
Role Variables
161161
--------------
162162
163-
This role has multiple variables. The descriptions and defaults for all these variables can be found in the **`defaults/main`** directory in the following files:
163+
This role has multiple variables. The descriptions and defaults for all these variables can be found in the **`defaults/main/`** directory in the following files:
164164

165165
- **[defaults/main/main.yml](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/main.yml):** NGINX installation variables
166166
- **[defaults/main/amplify.yml](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/amplify.yml):** NGINX Amplify agent installation variables
@@ -170,14 +170,14 @@ This role has multiple variables. The descriptions and defaults for all these va
170170
- **[defaults/main/bsd.yml](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/bsd.yml):** BSD installation variables
171171
- **[defaults/main/unit.yml](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/unit.yml):** NGINX Unit installation variables
172172

173-
Similarly, descriptions and defaults for preset variables can be found in the **`vars`** directory:
173+
Similarly, descriptions and defaults for preset variables can be found in the **`vars/`** directory in the following files:
174174

175-
- **[vars/main.yml](https://github.com/nginxinc/ansible-role-nginx/blob/main/vars/main.yml):** NGINX supported modules
175+
- **[vars/main.yml](https://github.com/nginxinc/ansible-role-nginx/blob/main/vars/main.yml):** List of supported NGINX platforms and modules
176176

177177
Example Playbooks
178178
-----------------
179179

180-
Working functional playbook examples can be found in the **`molecule/common`** directory in the following files:
180+
Working functional playbook examples can be found in the **`molecule/common/`** directory in the following files:
181181

182182
- **[molecule/common/playbooks/default_converge.yml](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/common/playbooks/default_converge.yml):** Install a specific version of NGINX and set up logrotate
183183
- **[molecule/common/playbooks/module_converge.yml](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/common/playbooks/module_converge.yml):** Install various NGINX supported modules

defaults/main/bsd.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
---
2-
# Supported distributions
3-
nginx_bsd_systems: ['FreeBSD', 'NetBSD', 'OpenBSD', 'DragonFlyBSD', 'HardenedBSD']
4-
5-
# Supported distributions NGINX Plus
6-
# https://docs.nginx.com/nginx/technical-specs/
7-
nginx_plus_bsd_systems: ['FreeBSD']
8-
92
# Choose to install BSD packages or ports.
103
# Options are true for packages or false for ports.
114
# Default is true.
@@ -21,6 +14,3 @@ nginx_bsd_update_ports: true
2114
# Options are true for use packages or false for do not use packages.
2215
# Default is true.
2316
nginx_bsd_portinstall_use_packages: true
24-
25-
# FreeBSD extra packages
26-
nginx_freebsd_extra_packages: ['security/ca_root_nss']

defaults/main/linux.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)