Skip to content
Ansible role for Nginx
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
defaults
files
handlers
tasks
templates
LICENSE
README.md

README.md

Ansible role for Nginx

CircleCI

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 defaults/main.yml.

Sample playbook

---

- hosts: myhost
  roles: nginx
  vars:
    nginx_server_tokens: 'off'
    nginx_logrotate_rotate: 7
    nginx_vhosts:
      - name: 'blog'
        hostname: 'domain.tld'
        template: 'blog.j2'
You can’t perform that action at this time.