Skip to content

Commit

Permalink
docs: Clarify role naming conventions
Browse files Browse the repository at this point in the history
Depending on how you have installed the role, the name might be either `nginxinc.nginx` or `ansible-role-nginx. Closes #694.
  • Loading branch information
alessfg committed Apr 15, 2024
1 parent 6d0795d commit 5ab3de7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ If you wish to install NGINX Plus using this role, you will need to obtain an NG

## Installation

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

### Ansible Galaxy

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

Alternatively, if you have already installed the role, update the role to the latest release:
Alternatively, if you have already installed the role, you can update the role to the latest release by using:

```bash
ansible-galaxy install -f nginxinc.nginx
```

To use the role, include the following task in your playbook:

```yaml
- name: Install NGINX
ansible.builtin.include_role:
name: nginxinc.nginx
```

### Git

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

To use the role, include the following task in your playbook:

```yaml
- name: Install NGINX
ansible.builtin.include_role:
name: <path/to/repo> # e.g. <roles/ansible-role-nginx> if you clone the repo inside your project's roles folder
```

## Platforms

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

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

## Other NGINX Ansible Collections and Roles

Expand Down
2 changes: 1 addition & 1 deletion molecule/agent/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Converge
hosts: all
tasks:
- name: Install NGINX Agent
- name: Install NGINX and NGINX Agent
ansible.builtin.include_role:
name: ansible-role-nginx
vars:
Expand Down
2 changes: 1 addition & 1 deletion molecule/amplify/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Converge
hosts: all
tasks:
- name: Install NGINX Amplify
- name: Install NGINX and NGINX Amplify
ansible.builtin.include_role:
name: ansible-role-nginx
vars:
Expand Down

0 comments on commit 5ab3de7

Please sign in to comment.