Skip to content

Commit 97e7203

Browse files
committed
docs: Clarify role naming conventions
Depending on how you have installed the role, the name might be either `nginxinc.nginx` or `ansible-role-nginx. Closes #694.
1 parent 6d0795d commit 97e7203

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ If you wish to install NGINX Plus using this role, you will need to obtain an NG
4949

5050
- Molecule is used to test the various functionalities of the role. The recommended version of Molecule to test this role is `4.x`.
5151
- 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.*
52-
- 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/) folder.
52+
- 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.
5353

5454
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:
5555

@@ -61,6 +61,8 @@ If you wish to install NGINX Plus using this role, you will need to obtain an NG
6161

6262
## Installation
6363

64+
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).
65+
6466
### Ansible Galaxy
6567

6668
To install the latest stable release of the role on your system, use:
@@ -69,12 +71,20 @@ To install the latest stable release of the role on your system, use:
6971
ansible-galaxy install nginxinc.nginx
7072
```
7173

72-
Alternatively, if you have already installed the role, update the role to the latest release:
74+
Alternatively, if you have already installed the role, you can update the role to the latest release by using:
7375

7476
```bash
7577
ansible-galaxy install -f nginxinc.nginx
7678
```
7779

80+
To use the role, include the following task in your playbook:
81+
82+
```yaml
83+
- name: Install NGINX
84+
ansible.builtin.include_role:
85+
name: nginxinc.nginx
86+
```
87+
7888
### Git
7989

8090
To pull the latest edge commit of the role from GitHub, use:
@@ -83,6 +93,14 @@ To pull the latest edge commit of the role from GitHub, use:
8393
git clone https://github.com/nginxinc/ansible-role-nginx.git
8494
```
8595

96+
To use the role, include the following task in your playbook:
97+
98+
```yaml
99+
- name: Install NGINX
100+
ansible.builtin.include_role:
101+
name: <path/to/repo> # e.g. <roles/ansible-role-nginx> if you clone the repo inside your project's roles directory
102+
```
103+
86104
## Platforms
87105

88106
The NGINX Ansible role supports almost all platforms supported by [NGINX Open Source](https://nginx.org/en/linux_packages.html), [NGINX Plus](https://docs.nginx.com/nginx/technical-specs/), the [NGINX Agent](https://docs.nginx.com/nginx-agent/technical-specifications/), and the [NGINX Amplify agent](https://github.com/nginxinc/nginx-amplify-doc/blob/master/amplify-faq.md#21-what-operating-systems-are-supported):
@@ -227,7 +245,7 @@ Ubuntu:
227245

228246
## Role Variables
229247

230-
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/blob/main/defaults/main/)** folder in the following files:
248+
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/blob/main/defaults/main/)** directory in the following files:
231249

232250
| Name | Description |
233251
| ---- | ----------- |
@@ -239,7 +257,7 @@ This role has multiple variables. The descriptions and defaults for all these va
239257
| **[`selinux.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/selinux.yml)** | SELinux configuration variables |
240258
| **[`systemd.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/systemd.yml)** | Systemd configuration variables |
241259

242-
Similarly, descriptions and defaults for preset variables can be found in the **[`vars/`](https://github.com/nginxinc/ansible-role-nginx/blob/main/vars/)** folder in the following files:
260+
Similarly, descriptions and defaults for preset variables can be found in the **[`vars/`](https://github.com/nginxinc/ansible-role-nginx/blob/main/vars/)** directory in the following files:
243261

244262
| Name | Description |
245263
| ---- | ----------- |
@@ -266,7 +284,7 @@ Working functional playbook examples can be found in the **[`molecule/`](https:/
266284
| **[`upgrade-plus/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/upgrade-plus/converge.yml)** | Upgrade NGINX Plus |
267285
| **[`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 |
268286

269-
Do note that if you install this repository via Ansible Galaxy, you will have to replace the role variable in the sample playbooks from `ansible-role-nginx` to `nginxinc.nginx`.
287+
**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`.
270288

271289
## Other NGINX Ansible Collections and Roles
272290

molecule/agent/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
- name: Converge
33
hosts: all
44
tasks:
5-
- name: Install NGINX Agent
5+
- name: Install NGINX and NGINX Agent
66
ansible.builtin.include_role:
77
name: ansible-role-nginx
88
vars:

molecule/amplify/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
- name: Converge
33
hosts: all
44
tasks:
5-
- name: Install NGINX Amplify
5+
- name: Install NGINX and NGINX Amplify
66
ansible.builtin.include_role:
77
name: ansible-role-nginx
88
vars:

0 commit comments

Comments
 (0)