This repository has been archived. There will likely be no further development on the project and security vulnerabilities may be unaddressed.
This collection contains all the roles maintained to support NGINX Controller 3.0 and later. The collection can be found on Ansible Galaxy.
It includes:
Experimental roles not yet published to Galaxy:
GitHub |
---|
ansible-role-nginx_controller_integration |
ansible-role-nginx_controller_forwarder |
Install this collection locally:
ansible-galaxy collection install nginxinc.nginx_controller -p ./collections
Then you can use the roles from the collection in your playbooks / plays:
---
- hosts: nginx_instances
collections:
- nginxinc.nginx_controller
roles:
- role: nginx
vars:
nginx_enable: true
nginx_start: true
nginx_type: plus
- role: nginx_controller_generate_token
vars:
nginx_controller_fqdn: controller.example.local
nginx_controller_user_email: user@example.local
nginx_controller_user_password: Secur3P@ssw0rd
- role: nginx_controller_agent
vars:
nginx_controller_fqdn: controller.example.local
It is possible to be more explicit. For example a fully-qualified role name such as
nginxinc.nginx_controller.nginx
instead ofnginx
is helpful if you maintain a differentnginx
role on your local workstation at a different local path.
Reference the Collection at the start of a playbook:
---
- hosts: localhost
gather_facts: no
collections:
- nginxinc.nginx_controller
tasks:
- name: load the vars.yaml
include_vars: "{{ playbook_dir }}/vars.yaml"
Using requirements.yaml
/collections/requirements.yml
---
collections:
- name: nginxinc.nginx_controller
#version: 3.3.1