Skip to content

Nginx installation and configuration role

License

Notifications You must be signed in to change notification settings

SoInteractive/ansible-nginx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nginx logo

Ansible Role: nginx

Build Status License: MIT Ansible Role GitHub tag Twitter URL

This role will install and configure nginx and its sites. It supports SSL/TLS termination and letsencrypt autorenewal directory.

⚠️ IMPORTANT NOTICE

THIS PROJECT IS ABANDONED. WE DO NOT ACCEPT ANY NEW ISSUES AND/OR PULL REQUESTS.

Disclaimer

Ideas taken from https://github.com/jdauphant/ansible-role-nginx

Requirements

When using metrics exporter, golang should be installed on deployer host. Also systemd is currently needed.

Let's encrypt

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 in nginx_sites for sites which need certificate.

Examples

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.