nginxinc / ansible-collection-nginx

Ansible collection for NGINX
Apache License 2.0
67 stars 23 forks source link
ansible ansible-collection nginx nginx-app-protect nginx-config nginx-plus

Ansible Galaxy License

👾 Help make the NGINX Ansible collection better by participating in our survey! 👾

Ansible NGINX Collection

The Ansible NGINX collection includes a variety of NGINX Ansible roles to help automate the installation and configuration of NGINX. This collection is maintained by NGINX.

Note: This collection is still in active development. There may be unidentified issues as development continues.

Included Content

The current stable release (0.8.0) of the Ansible NGINX collection includes the following roles:

Name Description Version
nginxinc.nginx Install NGINX 0.24.0
nginxinc.nginx_config Configure NGINX 0.6.0
nginxinc.nginx_app_protect Install and configure NGINX App Protect 0.9.0

Requirements

NGINX Plus (Optional)

If you wish to install NGINX Plus using this collection, you will need to obtain an NGINX Plus license beforehand. You do not need to do anything beforehand if you want to install NGINX OSS.

NGINX App Protect (Optional)

If you wish to install NGINX App Protect WAF or NGINX App Protect DoS using this collection, you will need to obtain the corresponding NGINX App Protect license beforehand.

Ansible

Jinja2

Molecule (Optional)

Installation

Ansible Galaxy

To install the latest stable release of the collection on your system, use:

ansible-galaxy collection install nginxinc.nginx_core

Alternatively, if you have already installed the collection, update the collection to the latest release:

ansible-galaxy collection install -f nginxinc.nginx_core

You can also include the collection in a requirements.yml file:

---
collections:
  - name: nginxinc.nginx_core
    version: 0.8.0

And install the collection:

ansible-galaxy collection install -r requirements.yml

Git

To pull the latest edge commit of the role from GitHub, use:

git clone https://github.com/nginxinc/ansible-collection-nginx.git

Usage

Sample playbooks for each use case covered by this collection can be found in the playbooks/ folder in the following files:

Name Description
deploy-nginx.yml Install NGINX
deploy-nginx-web-server.yml Install NGINX and configure a simple web server
deploy-nginx-web-server-proxy.yml Install NGINX and configure a simple reverse proxy in front of two web servers
deploy-nginx-plus.yml Install NGINX Plus
deploy-nginx-app-protect.yml Install NGINX App Protect WAF/DoS
deploy-nginx-plus-app-protect.yml Install NGINX Plus and NGINX App Protect WAF
deploy-nginx-plus-app-protect-web-server-proxy.yml Install NGINX Plus and NGINX App Protect and configure a simple reverse proxy in front of two web servers protected by NGINX App Protect WAF/DoS

Development

Currently, all the NGINX roles included in this collection (found in the roles/ folder) are Git submodules, and work on the roles themselves should take place in the corresponding upstream role repository.

To update the roles included in this collection to their latest version, use:

git submodule update --recursive --remote

Other NGINX Ansible Collections and Roles

You can find the Ansible NGINX Unit role to install NGINX Unit here.

License

Apache License, Version 2.0

Author Information

Alessandro Fael Garcia

© F5, Inc. 2020 - 2023