Home

ENG - Ansible Role Nginx

linux debian ansible

Simple ansible role to configure nginx on a remote machine.

This role can be founf there: github.com - stethewwolf/ansible-nginx-role

Introduction

This work shall be included into an ansible playbook as ansible role. This role is intented to manage containers running on a debian system.

In general this role allow to configure nginx:

Installed packages

This role will install following packages:

  nginx
  certbot

Configurations

Ports

Using the variables you can control if open http and https ports on the iptables firewall:

enable_http: true # default enable
enable_https: false # defalut disable

VirtualHosts

This is an example for virtual host creation

    nginx_vhosts:
      - { domain: "git.home.local", file: "{ { playbook_dir } }/files/nginx-vhosts/git.home.local", enabled: true, ssl: false }
      - { domain: "portainer.home.local", file: "{ { playbook_dir } }/files/nginx-vhosts/portainer.home.local", enabled: true, ssl: false }
      - { domain: "dns.home.local", file: "{ { playbook_dir } }/files/nginx-vhosts/dns.home.local", enabled: true, ssl: false }
      - { domain: "torrent.home.local", file: "{ { playbook_dir } }/files/nginx-vhosts/torrent.home.local", enabled: true, ssl: false }

Where:

References