Skip to content

Commit 02a9ee6

Browse files
authored
docs: Update README (#744)
1 parent ff12582 commit 02a9ee6

File tree

8 files changed

+94
-37
lines changed

8 files changed

+94
-37
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: ""
55
labels: ""
66
assignees: ""
77
---
8-
> [!WARNING]
8+
> [!CAUTION]
99
> Remember to redact any sensitive information such as authentication credentials or license keys.
1010
1111
### Describe the bug

.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
@@ -81,7 +81,7 @@ jobs:
8181

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

8686
- name: Run Molecule tests
8787
if: ${{ !(contains(matrix.scenario, 'plus')) || (env.NGINX_CRT != 0 && env.NGINX_KEY != 0) }}
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
@@ -14,6 +14,7 @@ FEATURES:
1414
DOCUMENTATION:
1515

1616
- Update community docs per the latest [NGINX template repository](https://github.com/nginxinc/template-repository) guidelines.
17+
- 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.
1718

1819
CI/CD:
1920

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ To suggest a feature or enhancement, please create an issue on GitHub with the l
4545
- Fork the repo, create a branch, implement your changes, add any relevant tests, and submit a PR when your changes are **tested** (using Molecule) and ready for review.
4646
- Fill in the [PR template](/.github/pull_request_template.md).
4747

48-
**Note:** If you'd like to implement a new feature, please consider creating a [feature request issue](/.github/feature_request_template.md) first to start a discussion about the feature.
48+
> [!NOTE]
49+
> If you'd like to implement a new feature, please consider creating a [feature request issue](/.github/feature_request_template.md) first to start a discussion about the feature.
4950
5051
#### F5 Contributor License Agreement (CLA)
5152

README.md

Lines changed: 86 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,94 @@
99

1010
# Ansible NGINX Role
1111

12-
This role installs NGINX Open Source, NGINX Plus, NGINX Agent or the NGINX Amplify agent on your target host.
12+
This role installs NGINX (NGINX Open Source), NGINX Plus, NGINX Agent and/or the NGINX Amplify agent on your target host(s).
1313

14-
**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.
1516
16-
## Requirements
17+
## Role Requirements
1718

18-
### NGINX Plus (Optional)
19+
### NGINX
1920

20-
If you wish to install NGINX Plus using this role, 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.*
21+
Depending on your target NGINX use case, you might need to obtain a license or API key/token before being able to use the role:
22+
23+
| Product | Requirements |
24+
|---------|--------------|
25+
| NGINX | None |
26+
| NGINX Plus | NGINX Plus license (both a license key and crt files) |
27+
| NGINX Agent | A compatible control plane and (optionally) an NGINX One SaaS console data plane token |
28+
| NGINX Amplify | API key found within the NGINX Amplify SaaS console |
2129

2230
### Ansible
2331

24-
- 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.12`).
25-
- When using Ansible core, you will also need to install the following collections:
26-
27-
```yaml
28-
---
29-
collections:
30-
- name: ansible.posix
31-
version: 1.5.4
32-
- name: community.general
33-
version: 9.0.1
34-
- name: community.crypto # Only required if you plan to install NGINX Plus
35-
version: 2.20.0
36-
- name: community.docker # Only required if you plan to use Molecule (see below)
37-
version: 3.10.3
38-
```
39-
40-
**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.
32+
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.
33+
34+
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:
35+
36+
```bash
37+
pip install --upgrade -r https://raw.githubusercontent.com/nginxinc/ansible-role-nginx/main/.github/workflows/requirements/requirements_ansible.txt
38+
curl -O https://raw.githubusercontent.com/nginxinc/ansible-role-nginx/main/.github/workflows/requirements/requirements_collections.yml
39+
ansible-galaxy install --force -r requirements_collections.yml
40+
rm -f requirements_collections.yml
41+
```
42+
43+
This will also ensure you are deploying/running this role with a fully tested version of the aforementioned packages/collections.
44+
45+
#### Ansible core
46+
47+
- 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.
48+
- When using Ansible core, you will also need to install the following Ansible collections:
49+
50+
```yaml
51+
---
52+
collections:
53+
- name: ansible.posix
54+
version: 1.5.4
55+
- name: community.general
56+
version: 9.0.1
57+
- name: community.crypto # Only required if you plan to install NGINX Plus
58+
version: 2.20.0
59+
- name: community.docker # Only required if you plan to use Molecule (see below)
60+
version: 3.10.3
61+
```
62+
4163
- You will need to run this role as a root user using Ansible's `become` parameter. Make sure you have set up the appropriate permissions on your target hosts.
42-
- 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).
64+
- 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.
65+
- 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.
4366

44-
### Jinja2
67+
> [!TIP]
68+
> 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.
69+
70+
#### Jinja2
4571

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

49-
### Molecule (Optional)
75+
### Testing suite (Optional)
76+
77+
If you want to contribute to this role, you will also need to install Ansible Lint and Molecule.
78+
79+
#### Ansible Lint (Optional)
5080

51-
- Molecule is used to test the various functionalities of the role. The recommended version of Molecule to test this role is `4.x`.
52-
- 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.*
53-
- To run the NGINX Plus Molecule tests, you must copy your NGINX Plus license to the role's [`files/license`](https://github.com/nginxinc/ansible-role-nginx/blob/main/files/license/) directory.
81+
- Ansible Lint is used to lint the role for both Ansible best practices and potential Ansible/YAML issues.
82+
- Instructions on how to install Ansible Lint can be found in the [Ansible Lint website](https://ansible.readthedocs.io/projects/lint/installing/).
83+
- Once installed, using Ansible Lint is as easy as running:
84+
85+
```bash
86+
ansible-lint
87+
```
88+
89+
- For ease of use, you can install and/or upgrade Ansible Lint by running the following command on your Ansible host:
90+
91+
```bash
92+
pip install -r https://raw.githubusercontent.com/nginxinc/ansible-role-nginx/main/.github/workflows/requirements/requirements_ansible_lint.txt
93+
```
94+
95+
#### Molecule (Optional)
96+
97+
- Molecule is used to test the various functionalities of the role.
98+
- 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.*
99+
- To run any of the NGINX Plus Molecule tests, you must first copy your NGINX Plus license to the role's [`files/license`](https://github.com/nginxinc/ansible-role-nginx/blob/main/files/license/) directory.
54100

55101
You can alternatively add your NGINX Plus 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:
56102

@@ -60,9 +106,15 @@ If you wish to install NGINX Plus using this role, you will need to obtain an NG
60106
molecule test -s plus
61107
```
62108

63-
## Installation
109+
- 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:
110+
111+
```bash
112+
pip install --upgrade -r https://raw.githubusercontent.com/nginxinc/ansible-role-nginx/main/.github/workflows/requirements/requirements_molecule.txt
113+
```
114+
115+
## Role Installation
64116

65-
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).
117+
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).
66118

67119
### Ansible Galaxy
68120

@@ -234,7 +286,8 @@ Ubuntu:
234286
- jammy (22.04)
235287
```
236288

237-
**Note:** At your own risk, you can also use this role to compile NGINX Open Source from source, install NGINX Open Source on "compatible" yet unsupported platforms, install NGINX from your respective distribution package manager, or install NGINX Open Source on BSD systems.
289+
> [!WARNING]
290+
> At your own risk, you can also use this role to compile NGINX Open Source from source, install NGINX Open Source on "compatible" yet unsupported platforms, install NGINX from your respective distribution package manager, or install NGINX Open Source on BSD systems.
238291

239292
## Role Variables
240293

@@ -277,7 +330,8 @@ Working functional playbook examples can be found in the **[`molecule/`](https:/
277330
| **[`upgrade-plus/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/upgrade-plus/converge.yml)** | Upgrade NGINX Plus |
278331
| **[`version/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/version/converge.yml)** | Install a specific version of NGINX and various NGINX modules |
279332

280-
**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` to `nginxinc.nginx`.
333+
> [!NOTE]
334+
> 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` to `nginxinc.nginx`.
281335

282336
## Other NGINX Ansible Collections and Roles
283337

0 commit comments

Comments
 (0)