Announcing a Unified Ansible Role for NGINX and NGINX Plus

Announcing a Unified Ansible Role for NGINX and NGINX Plus

NGINX, Inc. has been hard at work following the release of the original 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 supported. 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
  • Installing the three most popular NGINX modules (nginScript, Perl, and WAF)
  • Enabling metrics collection with the NGINX stub_status module or NGINX Plus extended status module
  • Enabling the NGINX Plus API and the live activity monitoring dashboard
  • Installing NGINX Amplify on your host system

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. To install the NGINX role, 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:
- ansible-role-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:

---
- hosts: tag_user_ubuntu
become: true
remote_user: ubuntu
roles:
- ansible-role-nginx

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.

---
- hosts: tag_user_ubuntu
become: true
remote_user: ubuntu
roles:
- ansible-role-nginx
vars:
type: plus
license:
certificate: /path/to/certificate
key: /path/to/key

For more details, including the list of variables you can specify, visit the GitHub repository for the NGINX Ansible role.

The post Announcing a Unified Ansible Role for NGINX and NGINX Plus appeared first on NGINX.

Source: Announcing a Unified Ansible Role for NGINX and NGINX Plus

About KENNETH 19688 Articles
지락문화예술공작단

Be the first to comment

Leave a Reply

Your email address will not be published.


*


이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.