Announcing a Unified Ansible Role for NGINX and NGINX Plus

NGINX, Inc. has been hard at work following the release of the original, separate Ansible roles for the open source NGINX software and NGINX Plus. We are now releasing a new, unified NGINX Ansible role.

This new Ansible role replaces the previous separate Ansible roles, which are no longer being maintained or updated. We will continue to develop the new Ansible role to support customer use cases as they change.

The new Ansible role can install either open source NGINX or NGINX Plus and has additional features, including:

Uploading NGINX configuration files from your host to the NGINX host

Dynamically creating NGINX configurations based on user variables

Choosing between the stable and mainline branches of open source NGINX

The new NGINX Ansible role is hosted at Ansible Galaxy, a free site for sharing, finding, and downloading roles. Downloading Ansible roles from Ansible Galaxy is a great way to jump‑start your automation projects.

Installing the new NGINX Ansible role from Ansible Galaxy is very simple. Run:

$ ansible-galaxy install nginxinc.nginx

You can then deploy NGINX or NGINX Plus on a local machine with a simple Ansible playbook:

---
- hosts: localhost
remote_user: root
roles:
- nginxinc.nginx

You can also configure Ansible to deploy to a cloud provider using a dynamic inventory. For sample instructions for an AWS EC2 inventory, see the AWS blog.

For example, the following playbook deploys NGINX to a dynamic inventory containing the user_ubuntu tag:

Deploying NGINX Plus within a cloud provider additionally requires you to define the location of the certificate and key for your NGINX Plus subscription. The recommended pathway for the license is the files subfolder within the NGINX Ansible role. To use a different location, specify it using Ansible variables.

Have a Cookie? :)

Our site uses cookies to provide functionality and performance as well as for social media and advertising purposes. Social media and advertising cookies of third parties are used to offer you social media functionalities and personalized ads for NGINX content and offers. To get more information about these cookies and how we process personal data, check our Privacy Policy. Do you accept the use of cookies and the processing of personal data involved?

Your Cookie Settings

Site functionality and performance

These cookies are required for NGINX site functionality and are therefore always enabled. These include cookies that allow you to be remembered as you explore the NGINX site, help make the shopping cart and checkout process possible as well as assist in security issues and conforming to regulations. To use the NGINX website, you have to consent to these cookies and the processing of personal data according to the NGINX website terms of use and privacy policy.

Social media and advertising

Social media cookies offer the possibility to connect you to your social networks and share content from our website through social media. Advertising cookies (of third parties) collect information to help better tailor NGINX advertising to your interests, both within and beyond NGINX websites. De-selecting these cookies may result in seeing advertising that is not as relevant to you or you not being able to link effectively with Facebook, Twitter, or other social networks and/or not allowing you to share content on social media.