Ansible role for Nginx
This is a role I made for myself but I tried to make it as reusable as possible while keeping it fitted to my use.
The role will install Nginx from the official APT stable repository for Debian or Ubuntu.
It will do some basic configuration like:
- Setting up nginx.conf
- Setting up the logrotate
- Setting up a default vhost
- Seeting up vhosts trough variables.
All the variables are in
--- - hosts: myhost roles: nginx vars: nginx_server_tokens: 'off' nginx_logrotate_rotate: 7 nginx_vhosts: - name: 'blog' hostname: 'domain.tld' template: 'blog.j2'