You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
histausse 2667d5affc
start writting config files
2 years ago
handlers add some files 2 years ago
tasks start writting config files 2 years ago
templates start writting config files 2 years ago
LICENSE first draft 2 years ago
README.md start writting config files 2 years ago

README.md

NGINX ansible role

Install nginx for debian

This role is part of my ansible roles. It is made to interact with other roles that are listed here, and require some variables.

Role required:

Variable required:

ansible_managed: str, msg indicating a file managed by ansible
http_sites: dictionnary of site, see the Http Sites section bellow

Optionnal variables

in_memoriam: str[], list of name to remember that will be advertised by `X-Clacks-Overhead`

Add role to you ansible playbook:

To add this role to your project, you can use git submodules:

git submodule add ssh://git@gitea.auro.re:2222/Pains-Perdus/nginx.git roles/nginx
git submodule init

Http Sites

The variable http_sites is a dictionnary of the http site managed by nginx.

http_sites:
  `server_name`:
    root_snippets:
      - ? TODO
    locations:
      `location`:
        template: `template`
        ...

server_name is the string corresponding to the server name (eg: "example.com").

root_snippets is a list of snippets/templates (To be determine) containing configurations for the http server.

locations is a dictionnary of location block. location (the key of an item) is the location (eg, "/"), template is the jinja template defining the contant of the location block. Other variables can be added to the location block depending on the template used.

Inside the templates, server_name is accessed with {{ item.key }}, en variables of the server block with {{ item.value.varname }}.

Inside templates of a location, in addition to the variables of the server block, the variables of the location block can be accessed with {{ location.value.varname }}, and the value of location with {{ location.key }}.

Copyright 2021 Jean-Marie Mineau histausse@protonmail.com