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: README.md
+23-5Lines changed: 23 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ If you wish to install NGINX Plus using this role, you will need to obtain an NG
49
49
50
50
- Molecule is used to test the various functionalities of the role. The recommended version of Molecule to test this role is `4.x`.
51
51
- 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.
53
53
54
54
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:
55
55
@@ -61,6 +61,8 @@ If you wish to install NGINX Plus using this role, you will need to obtain an NG
61
61
62
62
## Installation
63
63
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
+
64
66
### Ansible Galaxy
65
67
66
68
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:
69
71
ansible-galaxy install nginxinc.nginx
70
72
```
71
73
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:
73
75
74
76
```bash
75
77
ansible-galaxy install -f nginxinc.nginx
76
78
```
77
79
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
+
78
88
### Git
79
89
80
90
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:
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
+
86
104
## Platforms
87
105
88
106
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:
227
245
228
246
## Role Variables
229
247
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:
231
249
232
250
| Name | Description |
233
251
| ---- | ----------- |
@@ -239,7 +257,7 @@ This role has multiple variables. The descriptions and defaults for all these va
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:
243
261
244
262
| Name | Description |
245
263
| ---- | ----------- |
@@ -266,7 +284,7 @@ Working functional playbook examples can be found in the **[`molecule/`](https:/
266
284
| **[`upgrade-plus/converge.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/molecule/upgrade-plus/converge.yml)** | Upgrade NGINX Plus |
267
285
| **[`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 |
268
286
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`.
0 commit comments