Skip to content

anarres-org/anarres_nginx

Repository files navigation

NGINX

Ansible role to install, configure and launch Nginx.

It is part of anarres, a playbook that uses a collection of roles to deploy a full-featured server. But it can be used and tested independently.

It deploys a “Hello world!” default page and a robots.txt file disallowing all bots from /.

Cloning this repository

Since this repository has git submodules, after cloning the repository you'll have to

git submodule init
git submodule update

Alternatively you can clone it using

git clone --recurse-submodules -j8 {repo_url}

Compatibility

These are the tested GNU/Linux distributions. Maybe it works on some other distributions too or just requieres a few changes.

Requirements

In your local machine:

pip install -r requirements.txt

Role Variables

  • domain: Domain name for the server.
  • nginx_processes: Defines the number of nginx worker processes.
  • web_ports_http: Web port for nginx to bind to for HTTP connections.
  • web_ports_https: Web port for nginx to bind to for HTTPS connections.
  • web_path: Base webs path.
  • web_path_letsencrypt: Web path for letsencrypt, used to store ACME verification files.
  • web_path_default: Default web path.

Dependencies

sudo and python in the target host(s).

Example playbook

- hosts: all
  roles:
    - anarres_common
    - anarres_sec
    - anarres_letsencrypt
    - anarres_nginx

Testing

To test the role you need molecule, vagrant, virtualbox and some python requirements that can be installed wwith pip install -r requirements-dev.txt.

molecule test

or

make test

There is more documentation about the installation and configuration of the required tools at Testing - Anarres documentation.

License

GPLv3

Author Information

  • m0wer: m0wer (at) autistici (dot) org