Skip to content

Commit

Permalink
Few minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilien Mantel committed Dec 1, 2015
1 parent 17905ed commit 9779555
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,22 @@ You can see many examples in: [tests/test.yml](tests/test.yml).
- `more`: (O) Add more custom infos.
- `upstream_params`: (O) Add upstream params (useful when you want to pass variables to PHP)
- `override_try_files`: (O) overrides default try\_files defined in template
- `manage_local_content`: (O) Boolean. Set to false if you don't want to manage local content (images, css...). This option is useless if you use proxy `template`
- `manage_local_content`: (O) Boolean. Set to false if you don't want to manage local content (images, css...). This option is useless if you use `_proxy` template or `redirect_to` feature.

(O): Optional
(M): Mandatory
(D): Depends other keys...

#### Templates

- `base`: static template
- `dokuwiki`
- `phalcon`: Phalcon PHP Framework
- `php`: PHP base template. Can work with many frameworks/tools
- `php_index`: Same as above. But you can only run index.php
- `proxy`
- `wordpress`
- `_base`: static template
- `_dokuwiki`
- `_redirect`: should not be called explicitly
- `_phalcon`: Phalcon PHP Framework
- `_php`: PHP base template. Can work with many frameworks/tools
- `_php_index`: Same as above. But you can only run index.php
- `_proxy`
- `_wordpress`

Templates works as parent-child.

Expand All @@ -94,7 +95,6 @@ You have many key added to vhost key:
(O) : Optional
(M) : Mandatory


### Upstream management

- `nginx_upstreams`: List of dict. An upstream has few keys. See bellow.
Expand All @@ -114,8 +114,8 @@ You must set a `path`. For example: *192.168.0.50:8080* or *unix:/tmp/my.sock*.
All this params are optional. You should see [Nginx upstream doc](http://nginx.org/en/docs/http/ngx_http_upstream_module.html).

- `weight`
- `max`fails`
- `fail`timeout`
- `max_fails`
- `fail_timeout`
- `backup`
- `down`
- `route`
Expand All @@ -129,9 +129,7 @@ None
Example Playbook
----------------

- hosts: servers
roles:
- { role: HanXHX.nginx }
See [tests/test.yml](tests/test.yml).

License
-------
Expand All @@ -141,4 +139,5 @@ GPLv2
Author Information
------------------

- Twitter: https://twitter.com/hanxhx
- Twitter: [@hanxhx_](https://twitter.com/hanxhx_)

7 changes: 5 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nginx_log_dir: '/var/log/nginx'
nginx_ssl_dir: '/etc/nginx/ssl'
nginx_pid: '/run/nginx.pid'
nginx_resolver:
hosts: ['8.8.8.8', '8.8.4.4'] # OpenDNS
hosts: ['8.8.8.8', '8.8.4.4']
valid: '300'
timeout: '5'
nginx_error_log_level: 'warn' # http://nginx.org/en/docs/ngx_core_module.html#error_log
Expand All @@ -25,6 +25,7 @@ nginx_dh_length: 2048
nginx_php: false
nginx_php_sockets:
- unix_socket: "/var/run/php5-fpm.sock"
nginx_upstreams: []

#
# Nginx configuration
Expand Down Expand Up @@ -70,5 +71,7 @@ nginx_http:
gzip_disable: '"msie6"'
# etag: 'off'

#
# Vhosts
#
nginx_vhosts: []
nginx_upstreams: []
3 changes: 0 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,3 @@
- name: INCLUDE | Vhosts configuration
include: vhost.yml

# TODO:
# - Python
# - Ruby (SHIT!)
1 change: 1 addition & 0 deletions tasks/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- name: TEMPLATE | Deploy PHP upstream to Nginx
template: src=etc/nginx/upstream/php.conf.j2 dest=/etc/nginx/conf.d/php.conf
when: nginx_php
notify: reload nginx

- name: TEMPLATE | Deploy other upstreams
Expand Down

0 comments on commit 9779555

Please sign in to comment.