Skip to content

Commit

Permalink
Update NGINX Ansible collection to v0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alessfg committed Feb 17, 2022
1 parent 07cb5f0 commit 3b8b3a6
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 33 deletions.
82 changes: 63 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,63 @@ The Ansible NGINX collection includes a variety of NGINX Ansible roles to help a

## Included Content

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

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

## Requirements

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.
### NGINX Plus (Optional)

Instructions on how to install Ansible can be found in the [Ansible website](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).
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.*

### NGINX App Protect (Optional)

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.

### Ansible

* 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`).
* When using Ansible core, you will also need to install the following collections:

```yaml
---
collections:
- name: community.general
version: 4.4.0
- name: ansible.posix
version: 1.3.0
- name: community.docker # Only required if you plan to use Molecule (see below)
version: 2.1.1
```
**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.
* 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.
* 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).

### Jinja2

* 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`.
* Instructions on how to install Jinja2 can be found in the [Jinja2 website](https://jinja.palletsprojects.com/en/2.11.x/intro/#installation).

### Molecule (Optional)

* Molecule is used to test the various roles included in the collection. The recommended version of Molecule to test this role is `3.3`.
* At the moment, there are no end to end integration tests. You will need to change directory into each role's respective directory.
* 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.*
* 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.

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:

```bash
export NGINX_CRT=$( cat <path to your certificate file> | base64 )
export NGINX_KEY=$( cat <path to your key file> | base64 )
molecule test --all
```

## Installation

Expand All @@ -37,7 +81,7 @@ You can also include the collection in a `requirements.yml` file and install it
---
collections:
- name: nginxinc.nginx_core
version: 0.4.0
version: 0.5.0
```

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

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:

|Name|Description|
|----|-----------|
|**[`deploy-nginx.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx.yml)**|Install NGINX|
|**[`deploy-nginx-plus.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-plus.yml)**|Install NGINX Plus|
|**[`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|
|**[`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|
|**[`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|
|**[`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|
|**[`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|
| Name | Description |
| ---- | ----------- |
| **[`deploy-nginx.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx.yml)** | Install NGINX |
| **[`deploy-nginx-plus.yml`](https://github.com/nginxinc/ansible-collection-nginx/blob/main/playbooks/deploy-nginx-plus.yml)** | Install NGINX Plus |
| **[`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 |
| **[`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 |
| **[`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 |
| **[`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 |
| **[`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 |

## Development

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

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

&copy; [F5 Networks, Inc.](https://www.f5.com/) 2020 - 2021
&copy; [F5 Networks, Inc.](https://www.f5.com/) 2020 - 2022
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace: nginxinc
name: nginx_core
description: Install and configure NGINX and NGINX App Protect using Ansible
version: 0.4.0
version: 0.5.0
readme: README.md
license_file: LICENSE
authors:
Expand Down
6 changes: 2 additions & 4 deletions playbooks/deploy-nginx-plus-app-protect-web-server-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@
nginx_config_html_demo_template_enable: true
nginx_config_html_demo_template:
- template_file: www/index.html.j2
html_file_name: server_one.html
html_file_location: /usr/share/nginx/html
deployment_location: /usr/share/nginx/html/server_one.html
web_server_name: Ansible NGINX collection - Server one
- template_file: www/index.html.j2
html_file_name: server_two.html
html_file_location: /usr/share/nginx/html
deployment_location: /usr/share/nginx/html/server_two.html
web_server_name: Ansible NGINX collection - Server two
6 changes: 2 additions & 4 deletions playbooks/deploy-nginx-web-server-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@
nginx_config_html_demo_template_enable: true
nginx_config_html_demo_template:
- template_file: www/index.html.j2
html_file_name: server_one.html
html_file_location: /usr/share/nginx/html
deployment_location: /usr/share/nginx/html/server_one.html
web_server_name: Ansible NGINX collection - Server one
- template_file: www/index.html.j2
html_file_name: server_two.html
html_file_location: /usr/share/nginx/html
deployment_location: /usr/share/nginx/html/server_two.html
web_server_name: Ansible NGINX collection - Server two
3 changes: 1 addition & 2 deletions playbooks/deploy-nginx-web-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,5 @@
nginx_config_html_demo_template_enable: true
nginx_config_html_demo_template:
- template_file: www/index.html.j2
html_file_name: index.html
html_file_location: /usr/share/nginx/html
deployment_location: /usr/share/nginx/html/index.html
web_server_name: Ansible NGINX collection
2 changes: 1 addition & 1 deletion roles/nginx
Submodule nginx updated 56 files
+2 −2 .github/workflows/galaxy.yml
+6 −2 .github/workflows/molecule.yml
+2 −2 .github/workflows/requirements/requirements_ansible.yml
+1 −1 .github/workflows/requirements/requirements_galaxy.txt
+4 −4 .github/workflows/requirements/requirements_molecule.txt
+4 −0 .gitignore
+49 −2 CHANGELOG.md
+14 −17 README.md
+12 −16 defaults/main/main.yml
+3 −0 defaults/main/selinux.yml
+3 −0 handlers/main.yml
+1 −1 meta/main.yml
+3 −4 molecule/default/converge.yml
+7 −14 molecule/default/molecule.yml
+8 −0 molecule/default/verify.yml
+23 −0 molecule/downgrade/converge.yml
+77 −0 molecule/downgrade/molecule.yml
+29 −0 molecule/downgrade/prepare.yml
+33 −0 molecule/downgrade/verify.yml
+7 −14 molecule/module/molecule.yml
+2 −3 molecule/plus/converge.yml
+7 −14 molecule/plus/molecule.yml
+7 −14 molecule/source/molecule.yml
+9 −0 molecule/uninstall/converge.yml
+84 −0 molecule/uninstall/molecule.yml
+7 −0 molecule/uninstall/prepare.yml
+11 −0 molecule/uninstall/verify.yml
+11 −0 molecule/uninstall_plus/converge.yml
+84 −0 molecule/uninstall_plus/molecule.yml
+30 −0 molecule/uninstall_plus/prepare.yml
+11 −0 molecule/uninstall_plus/verify.yml
+9 −0 molecule/upgrade/converge.yml
+56 −0 molecule/upgrade/molecule.yml
+29 −0 molecule/upgrade/prepare.yml
+44 −0 molecule/upgrade/verify.yml
+1 −1 tasks/amplify/install-amplify.yml
+1 −10 tasks/amplify/setup-debian.yml
+1 −1 tasks/amplify/setup-redhat.yml
+1 −0 tasks/keys/setup-keys.yml
+60 −50 tasks/main.yml
+14 −11 tasks/modules/install-modules.yml
+4 −4 tasks/opensource/install-alpine.yml
+14 −14 tasks/opensource/install-bsd.yml
+18 −2 tasks/opensource/install-debian.yml
+5 −5 tasks/opensource/install-oss.yml
+5 −3 tasks/opensource/install-redhat.yml
+10 −6 tasks/opensource/install-source.yml
+3 −2 tasks/opensource/install-suse.yml
+2 −2 tasks/plus/install-alpine.yml
+4 −3 tasks/plus/install-debian.yml
+1 −1 tasks/plus/install-freebsd.yml
+4 −3 tasks/plus/install-redhat.yml
+2 −9 tasks/plus/install-suse.yml
+7 −0 tasks/plus/setup-license.yml
+1 −17 tasks/prerequisites/setup-selinux.yml
+22 −9 vars/main.yml

0 comments on commit 3b8b3a6

Please sign in to comment.