Skip to content

Commit 3b8b3a6

Browse files
committed
Update NGINX Ansible collection to v0.5.0
1 parent 07cb5f0 commit 3b8b3a6

8 files changed

+72
-33
lines changed

README.md

Lines changed: 63 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,63 @@ The Ansible NGINX collection includes a variety of NGINX Ansible roles to help a
1111

1212
## Included Content
1313

14-
The current stable release (`0.4.0`) of the Ansible NGINX collection includes the following roles:
14+
The current stable release (`0.5.0`) of the Ansible NGINX collection includes the following roles:
1515

16-
|Name|Description|Version|
17-
|----|-----------|-------|
18-
|[nginxinc.nginx](https://github.com/nginxinc/ansible-role-nginx)|Install NGINX|0.21.3|
19-
|[nginxinc.nginx_config](https://github.com/nginxinc/ansible-role-nginx-config)|Configure NGINX|0.4.2|
20-
|[nginxinc.nginx_app_protect](https://github.com/nginxinc/ansible-role-nginx-app-protect)|Install and configure NGINX App Protect|0.7.0|
16+
| Name | Description | Version |
17+
| ---- | ----------- | ------- |
18+
| [nginxinc.nginx](https://github.com/nginxinc/ansible-role-nginx) | Install NGINX | 0.23.0 |
19+
| [nginxinc.nginx_config](https://github.com/nginxinc/ansible-role-nginx-config) | Configure NGINX | 0.5.0 |
20+
| [nginxinc.nginx_app_protect](https://github.com/nginxinc/ansible-role-nginx-app-protect) | Install and configure NGINX App Protect | 0.7.1 |
2121

2222
## Requirements
2323

24-
This collection has been developed and tested with [maintained](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#release-status) versions of Ansible bigger than `2.11`. Backwards compatibility is not guaranteed.
24+
### NGINX Plus (Optional)
2525

26-
Instructions on how to install Ansible can be found in the [Ansible website](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).
26+
If you wish to install NGINX Plus using this collection, you will need to obtain an NGINX Plus license beforehand. *You do not need to do anything beforehand if you want to install NGINX OSS.*
27+
28+
### NGINX App Protect (Optional)
29+
30+
If you wish to install NGINX App Protect WAF or NGINX App Protect DoS using this collection, you will need to obtain the corresponding NGINX App Protect license beforehand.
31+
32+
### Ansible
33+
34+
* This collection is developed and tested with [maintained](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) versions of Ansible core (above `2.12`).
35+
* When using Ansible core, you will also need to install the following collections:
36+
37+
```yaml
38+
---
39+
collections:
40+
- name: community.general
41+
version: 4.4.0
42+
- name: ansible.posix
43+
version: 1.3.0
44+
- name: community.docker # Only required if you plan to use Molecule (see below)
45+
version: 2.1.1
46+
```
47+
48+
**Note:** You can alternatively install the Ansible community distribution (what is known as the "old" Ansible) if you don't want to manage individual collections.
49+
* You will need to run this collection as a root user using Ansible's `become` parameter. Make sure you have set up the appropriate permissions on your target hosts.
50+
* Instructions on how to install Ansible can be found in the [Ansible website](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#upgrading-ansible-from-version-2-9-and-older-to-version-2-10-or-later).
51+
52+
### Jinja2
53+
54+
* This collection uses Jinja2 templates. Ansible core installs Jinja2 by default, but depending on your install and/or upgrade path, you might be running an outdated version of Jinja2. The minimum version of Jinja2 required for the collection to properly function is `2.11`.
55+
* Instructions on how to install Jinja2 can be found in the [Jinja2 website](https://jinja.palletsprojects.com/en/2.11.x/intro/#installation).
56+
57+
### Molecule (Optional)
58+
59+
* Molecule is used to test the various roles included in the collection. The recommended version of Molecule to test this role is `3.3`.
60+
* At the moment, there are no end to end integration tests. You will need to change directory into each role's respective directory.
61+
* Instructions on how to install Molecule can be found in the [Molecule website](https://molecule.readthedocs.io/en/latest/installation.html). *You will also need to install the Molecule Docker driver.*
62+
* To run the NGINX Plus and/or NGINX App Protect Molecule tests, you must copy your corresponding license to the respective role's [`files/license`](https://github.com/nginxinc/ansible-role-nginx/blob/main/files/license/) folder.
63+
64+
You can alternatively add your NGINX certificate and key to the local environment. Run the following commands to export these files as base64-encoded variables and execute the Molecule tests:
65+
66+
```bash
67+
export NGINX_CRT=$( cat <path to your certificate file> | base64 )
68+
export NGINX_KEY=$( cat <path to your key file> | base64 )
69+
molecule test --all
70+
```
2771

2872
## Installation
2973

@@ -37,7 +81,7 @@ You can also include the collection in a `requirements.yml` file and install it
3781
---
3882
collections:
3983
- name: nginxinc.nginx_core
40-
version: 0.4.0
84+
version: 0.5.0
4185
```
4286

4387
### Git
@@ -48,15 +92,15 @@ Use `git clone https://github.com/nginxinc/ansible-collection-nginx.git` to pull
4892

4993
Sample playbooks for each use case covered by this collection can be found in the [`playbooks/`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/) folder in the following files:
5094

51-
|Name|Description|
52-
|----|-----------|
53-
|**[`deploy-nginx.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx.yml)**|Install NGINX|
54-
|**[`deploy-nginx-plus.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-plus.yml)**|Install NGINX Plus|
55-
|**[`deploy-nginx-app-protect.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-app-protect.yml)**|Install NGINX App Protect WAF/DoS|
56-
|**[`deploy-nginx-plus-app-protect.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-plus-app-protect.yml)**|Install NGINX Plus and NGINX App Protect WAF|
57-
|**[`deploy-nginx-web-server.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-web-server.yml)**|Install NGINX and configure a simple web server|
58-
|**[`deploy-nginx-web-server-proxy.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-web-server-proxy.yml)**|Install NGINX and configure a simple reverse proxy in front of two web servers|
59-
|**[`deploy-nginx-plus-app-protect-web-server-proxy.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-plus-app-protect-web-server-proxy.yml)**|Install NGINX Plus and NGINX App Protect and configure a simple reverse proxy in front of two web servers protected by NGINX App Protect WAF/DoS|
95+
| Name | Description |
96+
| ---- | ----------- |
97+
| **[`deploy-nginx.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx.yml)** | Install NGINX |
98+
| **[`deploy-nginx-plus.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-plus.yml)** | Install NGINX Plus |
99+
| **[`deploy-nginx-app-protect.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-app-protect.yml)** | Install NGINX App Protect WAF/DoS |
100+
| **[`deploy-nginx-plus-app-protect.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-plus-app-protect.yml)** | Install NGINX Plus and NGINX App Protect WAF |
101+
| **[`deploy-nginx-web-server.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-web-server.yml)** Install NGINX and configure a simple web server |
102+
| **[`deploy-nginx-web-server-proxy.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-web-server-proxy.yml)** | Install NGINX and configure a simple reverse proxy in front of two web servers |
103+
| **[`deploy-nginx-plus-app-protect-web-server-proxy.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-plus-app-protect-web-server-proxy.yml)** | Install NGINX Plus and NGINX App Protect and configure a simple reverse proxy in front of two web servers protected by NGINX App Protect WAF/DoS |
60104

61105
## Development
62106

@@ -78,4 +122,4 @@ You can find the Ansible NGINX Unit role to install NGINX Unit [here](https://gi
78122

79123
[Alessandro Fael Garcia](https://github.com/alessfg)
80124

81-
&copy; [F5 Networks, Inc.](https://www.f5.com/) 2020 - 2021
125+
&copy; [F5 Networks, Inc.](https://www.f5.com/) 2020 - 2022

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
namespace: nginxinc
33
name: nginx_core
44
description: Install and configure NGINX and NGINX App Protect using Ansible
5-
version: 0.4.0
5+
version: 0.5.0
66
readme: README.md
77
license_file: LICENSE
88
authors:

playbooks/deploy-nginx-plus-app-protect-web-server-proxy.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,8 @@
139139
nginx_config_html_demo_template_enable: true
140140
nginx_config_html_demo_template:
141141
- template_file: www/index.html.j2
142-
html_file_name: server_one.html
143-
html_file_location: /usr/share/nginx/html
142+
deployment_location: /usr/share/nginx/html/server_one.html
144143
web_server_name: Ansible NGINX collection - Server one
145144
- template_file: www/index.html.j2
146-
html_file_name: server_two.html
147-
html_file_location: /usr/share/nginx/html
145+
deployment_location: /usr/share/nginx/html/server_two.html
148146
web_server_name: Ansible NGINX collection - Server two

playbooks/deploy-nginx-web-server-proxy.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,8 @@
114114
nginx_config_html_demo_template_enable: true
115115
nginx_config_html_demo_template:
116116
- template_file: www/index.html.j2
117-
html_file_name: server_one.html
118-
html_file_location: /usr/share/nginx/html
117+
deployment_location: /usr/share/nginx/html/server_one.html
119118
web_server_name: Ansible NGINX collection - Server one
120119
- template_file: www/index.html.j2
121-
html_file_name: server_two.html
122-
html_file_location: /usr/share/nginx/html
120+
deployment_location: /usr/share/nginx/html/server_two.html
123121
web_server_name: Ansible NGINX collection - Server two

playbooks/deploy-nginx-web-server.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,5 @@
5757
nginx_config_html_demo_template_enable: true
5858
nginx_config_html_demo_template:
5959
- template_file: www/index.html.j2
60-
html_file_name: index.html
61-
html_file_location: /usr/share/nginx/html
60+
deployment_location: /usr/share/nginx/html/index.html
6261
web_server_name: Ansible NGINX collection

roles/nginx

Submodule nginx updated from 877b191 to 9044d8b

roles/nginx_config

0 commit comments

Comments
 (0)