This role will install and configure nginx and its sites. It supports SSL/TLS termination and letsencrypt autorenewal directory.
THIS PROJECT IS ABANDONED. WE DO NOT ACCEPT ANY NEW ISSUES AND/OR PULL REQUESTS.
Ideas taken from https://github.com/jdauphant/ansible-role-nginx
When using metrics exporter, golang should be installed on deployer host. Also systemd is currently needed.
This role can automatically generate letencrypt certificates. To do this you need an email previously used for some let's encrypt certificate and set some variables:
nginx_letsencrypt_email
- use
server_name
directive innginx_sites
for sites which need certificate.
Use it in a playbook as follows:
- hosts: all
become: true
roles:
- SoInteractive.nginx
Whenever needed, you can pass nginx_dh_remove_old=true
to ansible-playbook
execution to remove previous Diffie-Hellman parameters
Have a look at the defaults/main.yml for role variables that can be overridden.