Announcing the NGINX Core Collection for Ansible

NGINX | October 06, 2020

It’s the Year of Ansible at NGINX.

We believe in an app‑centric approach to application delivery that enables intelligent scaling of apps at the point of a bottleneck, eliminating the need to scale infrastructure across the entire app. Key in making this approach a reality is the vast ecosystem of CI/CD tools used by developers. As one of the most popular automation tools, Ansible enables NGINX users to quickly automate repetitive tasks across the app lifecycle. That’s why we’ve made a major investment in building out more Ansible roles and collections to enable easy automation of your NGINX environment. Over the last five years, we’ve grown our Ansible integration from a single blog post to two certified collections and 20+ roles – most of which were created in the last 9 months!

Why Use Ansible to Provision NGINX?

There are several excellent reasons to use Ansible to provision NGINX:

  1. You are probably already an Ansible user – and if not, you are at least seriously considering giving Ansible a try. Otherwise, you wouldn’t be here!
  2. Decentralized, resilient, and redundant multi‑cloud deployments are becoming more and more common. Ansible gives you the tooling you need to easily install and configure NGINX software across multiple target hosts.
  3. By using Ansible as your source of truth, you can achieve unparalleled, centralized insight into all your NGINX deployments. All your deployment information lives within your Ansible playbooks, which are written in YAML, one of the most readable configuration languages.
  4. Our collections are certified and fully supported by Red Hat. If things go wrong, Red Hat’s award‑winning support can help you get back on track.

Our Ansible History

Before we talk about the new NGINX Core collection, let’s review our journey with Ansible.

2015:

  • Published a blog describing how to create Ansible playbooks for installing NGINX and NGINX Plus. We were (rightly) told by a community member that our blog post would quickly become obsolete and we needed to develop and maintain an official Ansible role.

2017:

  • Launched our two first Ansible roles which separately performed basic installation of NGINX and NGINX Plus.

2018:

  • Unified the two initial roles into a single nginx role to install both NGINX and NGINX Plus.
  • Enhanced the nginx role to configure NGINX, install NGINX Unit, and install NGINX Amplify.

2020:

The Evolution of the nginx Role

The nginx role is one of the most popular roles on Ansible Galaxy, with more than 700,000 downloads since we launched it in 2018. But in spite of its popularity, we got feedback that it was heavy and took too long to install. While some people love a Swiss Army knife™ that can do everything, there’s a lot to be gained with a scalpel approach (an approach that Ansible itself has followed with the introduction of collections). With that in mind, we decided to split up the nginx role into three separate roles to enable greater flexibility and speed:

  • nginx – Installs NGINX and NGINX Plus
  • nginx_config – Configures NGINX and NGINX Plus
  • nginx_unit – Installs NGINX Unit

Introducing the NGINX Core Collection

In our continuous journey to improve our Ansible offerings, and following the introduction of collections in Ansible 2.10, we’ve created an NGINX collection that focuses on our “core” offering: software for fast and secure web serving, reverse proxy, and load balancing. As such, the NGINX Core collection includes three roles: the two roles for installing and configuring NGINX and NGINX Plus mentioned in the previous section (nginx and nginx_config), plus the nginx_app_protect role for installing and configuring NGINX App Protect, a fully featured WAF module for NGINX Plus.

Using the NGINX Core collection is as easy as using a role. To install it, run:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

You can then start using the collection’s roles in your playbooks by including the following lines at the beginning of your Ansible playbooks:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

The NGINX Core collection also comes with a series of playbooks that cover many use cases, ranging from a simple NGINX install to setting up a reverse proxy secured by NGINX App Protect in front of a couple of web servers. Alternatively, you can also check the playbooks included in each role’s molecule directory to find up-to-date working examples for each role.

Choosing Between the NGINX Core and NGINX Controller Collections

You might be wondering which of the two NGINX collections we offer is best for you. The answer, as is often the case, depends on your use case.

  • NGINX Core – Choose this collection if you:
    • Are an NGINX Open Source user
    • Are used to managing NGINX Plus directly
    • Want to configure NGINX App Protect
    • Don’t use NGINX Controller
  • NGINX Controller – Choose this collection if you are an NGINX Controller subscriber.

Get Started with NGINX Roles and Collections

If you’re an Ansible Automation Platform subscriber, you can access certified NGINX collections on Ansible Automation Hub (in the nginxinc namespace). Alternatively, you can find the upstream, community versions of our roles and collections on Ansible Galaxy. We hope you’ll join us at virtual AnsibleFest this October 13–14 and attend Alessandro’s session on the NGINX Core collection. Plus you can visit our virtual booth to chat with the authors, get exclusive access to demos and webinars, and win some swag!

We see our collections as a starting place that will grow over time through efforts from NGINX and the community. Please contribute to the collection and let us know what new functionality is important to you.

If you want to take NGINX Plus and NGINX App Protect for a spin, request a free 30-day trial today or contact us to discuss your use cases.

With Red Hat and NGINX working together, you get the best from both our companies! Together we:


Share

About the Author

Related Blog Posts

Automating Certificate Management in a Kubernetes Environment
NGINX | 10/05/2022

Automating Certificate Management in a Kubernetes Environment

Simplify cert management by providing unique, automatically renewed and updated certificates to your endpoints.

Secure Your API Gateway with NGINX App Protect WAF
NGINX | 05/26/2022

Secure Your API Gateway with NGINX App Protect WAF

As monoliths move to microservices, applications are developed faster than ever. Speed is necessary to stay competitive and APIs sit at the front of these rapid modernization efforts. But the popularity of APIs for application modernization has significant implications for app security.

How Do I Choose? API Gateway vs. Ingress Controller vs. Service Mesh
NGINX | 12/09/2021

How Do I Choose? API Gateway vs. Ingress Controller vs. Service Mesh

When you need an API gateway in Kubernetes, how do you choose among API gateway vs. Ingress controller vs. service mesh? We guide you through the decision, with sample scenarios for north-south and east-west API traffic, plus use cases where an API gateway is the right tool.

Deploying NGINX as an API Gateway, Part 2: Protecting Backend Services
NGINX | 01/20/2021

Deploying NGINX as an API Gateway, Part 2: Protecting Backend Services

In the second post in our API gateway series, Liam shows you how to batten down the hatches on your API services. You can use rate limiting, access restrictions, request size limits, and request body validation to frustrate illegitimate or overly burdensome requests.

New Joomla Exploit CVE-2015-8562
NGINX | 12/15/2015

New Joomla Exploit CVE-2015-8562

Read about the new zero day exploit in Joomla and see the NGINX configuration for how to apply a fix in NGINX or NGINX Plus.

Why Do I See “Welcome to nginx!” on My Favorite Website?
NGINX | 01/01/2014

Why Do I See “Welcome to nginx!” on My Favorite Website?

The ‘Welcome to NGINX!’ page is presented when NGINX web server software is installed on a computer but has not finished configuring

Deliver and Secure Every App
F5 application delivery and security solutions are built to ensure that every app and API deployed anywhere is fast, available, and secure. Learn how we can partner to deliver exceptional experiences every time.
Connect With Us
Announcing the NGINX Core Collection for Ansible | F5