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!
There are several excellent reasons to use Ansible to provision NGINX:
Before we talk about the new NGINX Core collection, let’s review our journey with Ansible.
2015:
2017:
2018:
2020:
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:
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:
$ ansible-galaxy collection install nginxinc.nginx_core
You can then start using the collection’s roles in your playbooks by including the following lines at the beginning of your Ansible playbooks:
---
- collections:
- name: nginxinc.nginx_core
version: 0.1.3
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.
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:
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:
"This blog post may reference products that are no longer available and/or no longer supported. For the most current information about available F5 NGINX products and solutions, explore our NGINX product family. NGINX is now part of F5. All previous NGINX.com links will redirect to similar NGINX content on F5.com."