nginxinc.nginx_config
Ansible NGINX Configuration Role
This role helps set up NGINX Open Source and NGINX Plus on your server.
Important
This role is still being developed. There may be unknown issues, and the variables you use could change as the development goes on.
What You Need
Ansible
To use this role, you need to have a supported version of Ansible and Jinja2, as well as some extra Ansible collections. You can easily install or upgrade everything by running these commands on your Ansible host:
pip install --upgrade -r https://raw.githubusercontent.com/nginxinc/ansible-role-nginx-config/main/.github/workflows/requirements/requirements_ansible.txt
curl -O https://raw.githubusercontent.com/nginxinc/ansible-role-nginx-config/main/.github/workflows/requirements/requirements_collections.yml
ansible-galaxy install --force -r requirements_collections.yml
rm -f requirements_collections.yml
Ansible Core
This role is created for and tested with recent versions of Ansible core and Python.
You also need to install these Ansible collections:
--- collections: - name: ansible.posix version: 1.5.4 - name: community.general version: 9.0.1 - name: community.docker # Only if you plan to use Molecule version: 3.10.3
Jinja2
- This role uses Jinja2 templates. You need at least Jinja2 version
3.1
. You can find installation instructions on the Jinja2 website.
Optional Tools
- If you want to help improve this role, you can install Ansible Lint and Molecule.
Ansible Lint
Use Ansible Lint to check your role for best practices.
Install it using:
pip install -r https://raw.githubusercontent.com/nginxinc/ansible-role-nginx-config/main/.github/workflows/requirements/requirements_ansible_lint.txt
Molecule
- Molecule helps you test the role's features. You can find installation instructions on the Molecule website.
How to Install This Role
You can install this role from Ansible Galaxy or by cloning the repo.
Ansible Galaxy
To install it, run:
ansible-galaxy install nginxinc.nginx_config
To update it:
ansible-galaxy install -f nginxinc.nginx_config
Git
To clone the role from GitHub, use:
git clone https://github.com/nginxinc/ansible-role-nginx-config.git
Supported Platforms
This role supports all platforms that NGINX Open Source and NGINX Plus support. You can use it to configure any NGINX installation at your own risk.
Role Variables
The role has many variables that are listed in the defaults/main/
directory:
main.yml
: Basic NGINX config variablesselinux.yml
: SELinux settings for NGINXtemplate.yml
: NGINX config template variablesupload.yml
: Upload settings
Example Playbooks
You can find helpful example playbooks in the molecule/
directory.
Other NGINX Ansible Collections and Roles
You can find other resources for installing and configuring NGINX here:
License
This project is under the Apache License, Version 2.0.
Author Information
Created by Alessandro Fael Garcia at F5, Inc. 2020 - 2024.
Official Ansible role for configuring NGINX
ansible-galaxy install nginxinc.nginx_config