Official Ansible Roles for NGINX and NGINX Plus Out Now

Note: Check out these related blogs about other DevOps automation tools for NGINX and NGINX Plus:

NGINX, Inc. has created officially supported Ansible roles for the open source NGINX software and NGINX Plus, available on Ansible Galaxy. These Ansible roles will be in continual development to support customer use cases.

A playbook is the Ansible automation engine for application deployment, enabling users to install and configure applications across multiple servers, environments, and operating systems, all from one central location. An Ansible role, in turn, bundles Ansible variables, tasks, and handlers into a clearly defined file structure. An Ansible role can be dropped into an Ansible playbook and immediately put to work.

You can find community‑developed roles at Ansible Galaxy, a free site for sharing, finding, and downloading roles. Downloading roles from Ansible Galaxy is a great way to jumpstart your automation projects.

Installing the NGINX roles from Ansible Galaxy is very simple. To install the NGINX OSS role, run:

$ ansible-galaxy install nginxinc.nginx-oss

To install the NGINX Plus role, run:

$ ansible-galaxy install nginxinc.nginx-plus

You can now deploy NGINX OSS within a cloud provider with a simple Ansible playbook:

---
- hosts: localhost
remote_user: root
become: true
roles:
- role: ansible-nginx-oss

You can also easily deploy NGINX OSS to a dynamic inventory containing the NGINX tag:

--
- hosts: tag_nginx
remote_user: root
become: true
roles:
- role: ansible-nginx-oss

Deploying NGINX Plus within a cloud provider additionally requires you to define the location of the certificate and key you received with your NGINX Plus license:

---
- hosts: localhost
remote_user: root
become: true
roles:
- role: ansible-nginx-plus
vars:
- certs: ~/certs/

Similarly, specify the location of your NGINX Plus certificate and key when deploying NGINX Plus within a dynamic inventory containing the NGINX tag:

---
- hosts: tag_nginx
remote_user: root
become: true
roles:
- role: ansible-nginx-plus
vars:
- certs: ~/certs/

For more details, visit the Ansible Galaxy pages for NGINX and NGINX Plus.

We also welcome your contributions on GitHub, for both the NGINX and NGINX Plus roles.

Cover image
Microservices: From Design to Deployment
The complete guide to microservices development