You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ TESTS:
19
19
DOCUMENTATION:
20
20
21
21
- Update community docs per the latest [NGINX template repository](https://github.com/nginxinc/template-repository) guidelines.
22
+
- Update and tweak the README. In order to make the installation instructions easier, some file names used by the various GitHub Actions workflows have been renamed.
[](https://www.repostatus.org/#active)
# 👾 *Help make the NGINX config Ansible role better by participating in our [survey](https://forms.office.com/Pages/ResponsePage.aspx?id=L_093Ttq0UCb4L-DJ9gcUKLQ7uTJaE1PitM_37KR881UM0NCWkY5UlE5MUYyWU1aTUcxV0NRUllJSC4u)!* 👾
8
9
9
10
# Ansible NGINX Configuration Role
10
11
11
12
This role configures NGINX Open Source and NGINX Plus on your target host.
12
13
13
-
**Note:** This role is still in active development. There may be unidentified issues and the role variables may change as development continues.
14
+
> [!IMPORTANT]
15
+
> This role is still in active development. There may be unidentified issues and the role variables may change as development continues.
14
16
15
-
## Requirements
17
+
## Role Requirements
16
18
17
19
### Ansible
18
20
19
-
- This role is developed and tested with [maintained](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) versions of Ansible core (above `2.16`).
20
-
- When using Ansible core, you will also need to install the following collections:
21
+
If you want to use this role, you will need to use a supported version of Ansible core and Jinja2 as well as a few Ansible collections.
21
22
22
-
```yaml
23
-
---
24
-
collections:
25
-
- name: ansible.posix
26
-
version: 1.5.4
27
-
- name: community.general
28
-
version: 9.2.0
29
-
- name: community.docker # Only required if you plan to use Molecule (see below)
30
-
version: 3.11.0
31
-
```
23
+
For ease of use, you can install and/or upgrade Ansible core, Jinja2, and the aforementioned Ansible collections by running the following four commands on your Ansible host:
32
24
33
-
**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.
34
-
- 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).
This will also ensure you are deploying/running this role with a fully tested version of the aforementioned packages/collections.
33
+
34
+
#### Ansible core
35
+
36
+
- This role is developed and tested with [maintained](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) versions of Ansible core and Python.
37
+
- When using Ansible core, you will also need to install the following Ansible collections:
38
+
39
+
```yaml
40
+
---
41
+
collections:
42
+
- name: ansible.posix
43
+
version: 1.5.4
44
+
- name: community.general
45
+
version: 9.0.1
46
+
- name: community.docker # Only required if you plan to use Molecule (see below)
47
+
version: 3.10.3
48
+
```
49
+
50
+
- Instructions on how to install Ansible core can be found in the [Ansible](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) docs.
51
+
- Instructions on how to install Ansible collections can be found in the [Ansible collections](https://docs.ansible.com/ansible/latest/collections_guide/collections_installing.html) guide.
52
+
53
+
> [!TIP]
54
+
> You can alternatively install the [Ansible community distribution](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#selecting-an-ansible-package-and-version-to-install) (what is still known Ansible -- instead of Ansible core) if you don't want to manage individual collections.
35
55
36
56
### Jinja2
37
57
38
58
- This role 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 role to properly function is `3.1`.
39
59
- Instructions on how to install Jinja2 can be found in the [Jinja2 website](https://jinja.palletsprojects.com/en/3.1.x/intro/#installation).
40
60
41
-
### Molecule (Optional)
61
+
### Testing suite (Optional)
62
+
63
+
If you want to contribute to this role, you will also need to install Ansible Lint and Molecule.
64
+
65
+
#### Ansible Lint (Optional)
66
+
67
+
- Ansible Lint is used to lint the role for both Ansible best practices and potential Ansible/YAML issues.
68
+
- Instructions on how to install Ansible Lint can be found in the [Ansible Lint website](https://ansible.readthedocs.io/projects/lint/installing/).
69
+
- Once installed, using Ansible Lint is as easy as running:
42
70
43
-
- Molecule is used to test the various functionalities of the role. The recommended version of Molecule to test this role is `4.x`.
44
-
- 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.*
45
-
- To run the NGINX Plus/App Protect config Molecule tests, you must copy your NGINX Plus/App Protect license to the role's [`files/license`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/files/license/) directory.
71
+
```bash
72
+
ansible-lint
73
+
```
74
+
75
+
- For ease of use, you can install and/or upgrade Ansible Lint by running the following command on your Ansible host:
- Molecule is used to test the various functionalities of the role.
84
+
- 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 plugins package and the Docker Python SDK.*
85
+
- To run the NGINX Plus/App Protect config Molecule tests, you must copy your NGINX Plus/App Protect license to the role's Molecule [`common/files/license`](/molecule/common/files/license/) directory.
46
86
47
87
You can alternatively add your NGINX Plus/App Protect repository certificate and key to the local environment. Run the following commands to export these files as base64-encoded variables and execute the Molecule tests:
48
88
@@ -52,9 +92,15 @@ This role configures NGINX Open Source and NGINX Plus on your target host.
52
92
molecule test -s plus
53
93
```
54
94
55
-
## Installation
95
+
- For ease of use, you can install and/or upgrade Molecule, the Molecule plugins package, and the Docker Python SDK by running the following command on your Ansible host:
This role can be installed via either Ansible Galaxy (the Ansible community marketplace) or by cloning this repo. Once installed, you will need to include the role it in your Ansible playbook using [the `roles` keyword, the `import_role` module, or the `include_role` module](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#using-roles).
103
+
This role can be installed via either Ansible Galaxy (the Ansible community marketplace) or by cloning this repo. Once installed, you will need to include the role in your Ansible playbook using [the `roles` keyword, the `import_role` module, or the `include_role` module](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#using-roles).
58
104
59
105
### Ansible Galaxy
60
106
@@ -98,36 +144,38 @@ To use the role, include the following task in your playbook:
98
144
99
145
The NGINX config Ansible role supports all platforms supported by [NGINX Open Source](https://nginx.org/en/linux_packages.html#mainline) and [NGINX Plus](https://www.nginx.com/products/technical-specs/).
100
146
101
-
***Note:** You should be able to use this role to configure any NGINX installation -- wherever/however it's been installed -- at your own risk. Any potential bugs with the role involving unsupported installation methods/platforms will be addressed in a best effort manner and might be outright dismissed.*
147
+
> [!NOTE]
148
+
> You should be able to use this role to configure any NGINX installation -- wherever/however it's been installed -- at your own risk. Any potential bugs with the role involving unsupported installation methods/platforms will be addressed in a best effort manner and might be outright dismissed.*
102
149
103
150
## Role Variables
104
151
105
-
This role has multiple variables. The descriptions and defaults for all these variables can be found in the **[`defaults/main/`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/defaults/main/)** directory in the following files:
152
+
This role has multiple variables. The descriptions and defaults for all these variables can be found in the **[`defaults/main/`](/defaults/main/)** directory in the following files:
| **[`selinux.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/defaults/main/selinux.yml)** | Set up SELinux to allow the necessary connections to your NGINX setup |
Working functional playbook examples can be found in the **[`molecule/`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/molecule/)** directory in the following files:
163
+
Working functional playbook examples can be found in the **[`molecule/`](/molecule/)** directory in the following files:
117
164
118
165
| Name | Description |
119
166
| ---- | ----------- |
120
-
| **[`api/converge.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/molecule/api/converge.yml)** | Configure the NGINX Plus API and live metrics dashboard |
121
-
| **[`cleanup_config/converge.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/molecule/cleanup_config/converge.yml)** | Cleanup an NGINX config |
122
-
| **[`complete/converge.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/molecule/complete/converge.yml)** | Test all NGINX directives are correctly templated |
123
-
| **[`complete_plus/converge.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/molecule/complete_plus/converge.yml)** | Test all NGINX Plus specific directives are correctly templated |
124
-
| **[`default/converge.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/molecule/default/converge.yml)** | Configure NGINX with a config as close as possible to the default config |
125
-
| **[`push_config/converge.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/molecule/push_config/converge.yml)** | Push a preexisting NGINX config from your system to your NGINX instance |
126
-
| **[`reverse_proxy/converge.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/molecule/reverse_proxy/converge.yml)** | Configure NGINX as a reverse proxy between two web servers |
127
-
| **[`stub_status/converge.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/molecule/stub_status/converge.yml)** | Configure the NGINX Open Source stub status metrics |
128
-
| **[`web_server/converge.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/molecule/web_server/converge.yml)** | Configure NGINX as a web server |
129
-
130
-
**Note:** If you install this repository via Ansible Galaxy, you will need to replace the `include_role` variable in the example playbooks from `ansible-role-nginx-config` to `nginxinc.nginx_config`.
167
+
| **[`api/converge.yml`](/molecule/api/converge.yml)** | Configure the NGINX Plus API and live metrics dashboard |
168
+
| **[`cleanup_config/converge.yml`](/molecule/cleanup_config/converge.yml)** | Cleanup an NGINX config |
169
+
| **[`complete/converge.yml`](/molecule/complete/converge.yml)** | Test all NGINX directives are correctly templated |
170
+
| **[`complete_plus/converge.yml`](/molecule/complete_plus/converge.yml)** | Test all NGINX Plus specific directives are correctly templated |
171
+
| **[`default/converge.yml`](/molecule/default/converge.yml)** | Configure NGINX with a config as close as possible to the default config |
172
+
| **[`push_config/converge.yml`](/molecule/push_config/converge.yml)** | Push a preexisting NGINX config from your system to your NGINX instance |
173
+
| **[`reverse_proxy/converge.yml`](/molecule/reverse_proxy/converge.yml)** | Configure NGINX as a reverse proxy between two web servers |
174
+
| **[`stub_status/converge.yml`](/molecule/stub_status/converge.yml)** | Configure the NGINX Open Source stub status metrics |
175
+
| **[`web_server/converge.yml`](/molecule/web_server/converge.yml)** | Configure NGINX as a web server |
176
+
177
+
> [!NOTE]
178
+
> If you install this repository via Ansible Galaxy, you will need to replace the `include_role` variable in the example playbooks from `ansible-role-nginx-config` to `nginxinc.nginx_config`.
131
179
132
180
## Other NGINX Ansible Collections and Roles
133
181
@@ -141,7 +189,7 @@ You can find the Ansible NGINX Unit role to install NGINX Unit [here](https://gi
141
189
142
190
## License
143
191
144
-
[Apache License, Version 2.0](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/LICENSE)
0 commit comments