2015-07-16 16:44:25 +07:00
|
|
|
Nginx for Debian Ansible role
|
|
|
|
=============================
|
2015-07-15 17:14:39 +07:00
|
|
|
|
2015-07-16 16:44:25 +07:00
|
|
|
Install and configure Nginx on Debian
|
2015-07-15 17:14:39 +07:00
|
|
|
|
|
|
|
Requirements
|
|
|
|
------------
|
|
|
|
|
2015-07-16 16:44:25 +07:00
|
|
|
None.
|
2015-07-15 17:14:39 +07:00
|
|
|
|
|
|
|
Role Variables
|
|
|
|
--------------
|
|
|
|
|
2015-07-16 16:44:25 +07:00
|
|
|
- `nginx_apt_package`: APT nginx package (try: apt-cache search ^nginx)
|
|
|
|
- `nginx_root`: root directory where you want to have your files
|
|
|
|
- `nginx_log_dir`: log directory (if you change it, don't forget to change logrotate config)
|
|
|
|
- `nginx_ssl_dir`: directory where you install your SSL/TLS keys
|
|
|
|
- `nginx_resolver`: list of DNS resolver (default: OpenDNS)
|
|
|
|
- `nginx_error_log_level`: default log level
|
|
|
|
- `nginx_dh_length`: DH key length (default is 2048)
|
|
|
|
|
|
|
|
### PHP
|
|
|
|
|
|
|
|
- `nginx_php`: boolean if you need to preconfigure PHP (default: false)
|
|
|
|
- `nginx_php_sockets`: list of //sockets//
|
|
|
|
|
|
|
|
You should see [Nginx upstream module doc](http://nginx.org/en/docs/http/ngx_http_upstream_module.html).
|
|
|
|
|
|
|
|
Socket:
|
|
|
|
- `unix_socket`
|
|
|
|
- `host`
|
|
|
|
- `port`
|
|
|
|
- `weight`
|
|
|
|
- `max_fails`
|
|
|
|
- `fail_timeout`
|
|
|
|
|
|
|
|
### Nginx Configuration
|
|
|
|
|
|
|
|
- `nginx_user`
|
|
|
|
- `nginx_worker_processes`
|
|
|
|
- `nginx_events`: key/value in events block
|
|
|
|
- `nginx_http`: key/value in http block
|
|
|
|
|
|
|
|
### Vhost management
|
|
|
|
|
|
|
|
- `nginx_vhosts`:
|
|
|
|
|
|
|
|
You need at least : "name". you can configure many templates (and yours !).
|
|
|
|
|
|
|
|
Few tips:
|
|
|
|
- if you need another root (glpi, phpmyadmin... etc), you can specify "root"
|
|
|
|
- you can use your own templates, you must keep the same directory organization
|
|
|
|
- you should see COMMON.j2 to see all abilities
|
|
|
|
|
2015-07-30 18:02:21 +07:00
|
|
|
You can see many examples in: [tests/test.yml](tests/test.yml).
|
2015-07-15 17:14:39 +07:00
|
|
|
|
|
|
|
Dependencies
|
|
|
|
------------
|
|
|
|
|
2015-07-16 16:44:25 +07:00
|
|
|
None
|
2015-07-15 17:14:39 +07:00
|
|
|
|
|
|
|
Example Playbook
|
|
|
|
----------------
|
|
|
|
|
|
|
|
- hosts: servers
|
|
|
|
roles:
|
2015-07-16 16:44:25 +07:00
|
|
|
- { role: HanXHX.nginx }
|
2015-07-15 17:14:39 +07:00
|
|
|
|
|
|
|
License
|
|
|
|
-------
|
|
|
|
|
2015-07-16 16:44:25 +07:00
|
|
|
GPLv2
|
2015-07-15 17:14:39 +07:00
|
|
|
|
|
|
|
Author Information
|
|
|
|
------------------
|
|
|
|
|
2015-07-16 16:44:25 +07:00
|
|
|
- You can find many other roles in my GitHub "lab": https://github.com/HanXHX/my-ansible-playbooks
|
|
|
|
- All issues, pull-request are welcome :)
|
|
|
|
|