Skip to content

Commit 6d14ed3

Browse files
committed
docs: Update README (#451)
1 parent 511d91a commit 6d14ed3

File tree

6 files changed

+95
-45
lines changed

6 files changed

+95
-45
lines changed

.github/workflows/galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
python-version: 3.x
2020

2121
- name: Install Ansible core
22-
run: pip3 install -r .github/workflows/requirements/requirements_galaxy.txt
22+
run: pip3 install -r .github/workflows/requirements/requirements_ansible.txt
2323

2424
- name: Import role releases to Ansible Galaxy
2525
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)

.github/workflows/molecule.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: pip3 install -r .github/workflows/requirements/requirements_ansible_lint.txt
2828

2929
- name: Install Ansible core collection dependencies
30-
run: ansible-galaxy install -r .github/workflows/requirements/requirements_ansible.yml
30+
run: ansible-galaxy install -r .github/workflows/requirements/requirements_collections.yml
3131

3232
- name: Run Ansible Lint
3333
run: ansible-lint --force-color
@@ -69,7 +69,7 @@ jobs:
6969

7070
- name: Install Ansible core collection dependencies
7171
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
72-
run: ansible-galaxy install -r .github/workflows/requirements/requirements_ansible.yml
72+
run: ansible-galaxy install -r .github/workflows/requirements/requirements_collections.yml
7373

7474
- name: Run Molecule tests
7575
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
ansible-core==2.16.6
2+
jinja2==3.1.4

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ TESTS:
1919
DOCUMENTATION:
2020

2121
- 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.
2223

2324
CI/CD:
2425

README.md

Lines changed: 90 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,87 @@
22
[![Molecule CI/CD](https://github.com/nginxinc/ansible-role-nginx-config/workflows/Molecule%20CI/CD/badge.svg)](https://github.com/nginxinc/ansible-role-nginx-config/actions)
33
[![License](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
44
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
5-
[![Community Support](https://badgen.net/badge/support/community/cyan?icon=awesome)](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/SUPPORT.md)
5+
[![Community Support](https://badgen.net/badge/support/community/cyan?icon=awesome)](/SUPPORT.md)
6+
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](/CODE_OF_CONDUCT.md)
67

78
# 👾 *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)!* 👾
89

910
# Ansible NGINX Configuration Role
1011

1112
This role configures NGINX Open Source and NGINX Plus on your target host.
1213

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.
1416
15-
## Requirements
17+
## Role Requirements
1618

1719
### Ansible
1820

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.
2122

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:
3224

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).
25+
```bash
26+
pip install --upgrade -r https://raw.githubusercontent.com/nginxinc/ansible-role-nginx-config/main/.github/workflows/requirements/requirements_ansible.txt
27+
curl -O https://raw.githubusercontent.com/nginxinc/ansible-role-nginx-config/main/.github/workflows/requirements/requirements_collections.yml
28+
ansible-galaxy install --force -r requirements_collections.yml
29+
rm -f requirements_collections.yml
30+
```
31+
32+
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.
3555
3656
### Jinja2
3757
3858
- 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`.
3959
- Instructions on how to install Jinja2 can be found in the [Jinja2 website](https://jinja.palletsprojects.com/en/3.1.x/intro/#installation).
4060

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:
4270

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:
76+
77+
```bash
78+
pip install -r https://raw.githubusercontent.com/nginxinc/ansible-role-nginx-config/main/.github/workflows/requirements/requirements_ansible_lint.txt
79+
```
80+
81+
#### Molecule (Optional)
82+
83+
- 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.
4686

4787
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:
4888

@@ -52,9 +92,15 @@ This role configures NGINX Open Source and NGINX Plus on your target host.
5292
molecule test -s plus
5393
```
5494

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:
96+
97+
```bash
98+
pip install --upgrade -r https://raw.githubusercontent.com/nginxinc/ansible-role-nginx-config/main/.github/workflows/requirements/requirements_molecule.txt
99+
```
100+
101+
## Role Installation
56102

57-
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).
58104

59105
### Ansible Galaxy
60106

@@ -98,36 +144,38 @@ To use the role, include the following task in your playbook:
98144

99145
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/).
100146

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.*
102149

103150
## Role Variables
104151

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:
106153

107154
| Name | Description |
108155
| ---- | ----------- |
109-
| **[`main.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/defaults/main/main.yml)** | NGINX simple config variables |
110-
| **[`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 |
111-
| **[`template.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/defaults/main/template.yml)** | NGINX config template variables |
112-
| **[`upload.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/defaults/main/upload.yml)** | NGINX config/HTML/SSL upload variables |
156+
| **[`main.yml`](/defaults/main/main.yml)** | NGINX simple config variables |
157+
| **[`selinux.yml`](/defaults/main/selinux.yml)** | Set up SELinux to allow the necessary connections to your NGINX setup |
158+
| **[`template.yml`](/defaults/main/template.yml)** | NGINX config template variables |
159+
| **[`upload.yml`](/defaults/main/upload.yml)** | NGINX config/HTML/SSL upload variables |
113160

114161
## Example Playbooks
115162

116-
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:
117164

118165
| Name | Description |
119166
| ---- | ----------- |
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`.
131179

132180
## Other NGINX Ansible Collections and Roles
133181

@@ -141,7 +189,7 @@ You can find the Ansible NGINX Unit role to install NGINX Unit [here](https://gi
141189

142190
## License
143191

144-
[Apache License, Version 2.0](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/LICENSE)
192+
[Apache License, Version 2.0](/LICENSE)
145193

146194
## Author Information
147195

0 commit comments

Comments
 (0)