From 9779555ac872677e5bcb98d2a3b3a305b0ac8085 Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Tue, 1 Dec 2015 16:35:56 +0100 Subject: [PATCH] Few minor changes --- README.md | 29 ++++++++++++++--------------- defaults/main.yml | 7 +++++-- tasks/main.yml | 3 --- tasks/upstream.yml | 1 + 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index fee0adf..67d011a 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ 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 @@ -72,13 +72,14 @@ You can see many examples in: [tests/test.yml](tests/test.yml). #### 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. @@ -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. @@ -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` @@ -129,9 +129,7 @@ None Example Playbook ---------------- - - hosts: servers - roles: - - { role: HanXHX.nginx } +See [tests/test.yml](tests/test.yml). License ------- @@ -141,4 +139,5 @@ GPLv2 Author Information ------------------ -- Twitter: https://twitter.com/hanxhx +- Twitter: [@hanxhx_](https://twitter.com/hanxhx_) + diff --git a/defaults/main.yml b/defaults/main.yml index 28d1446..d380829 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 @@ -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 @@ -70,5 +71,7 @@ nginx_http: gzip_disable: '"msie6"' # etag: 'off' +# +# Vhosts +# nginx_vhosts: [] -nginx_upstreams: [] diff --git a/tasks/main.yml b/tasks/main.yml index 897cd15..16b5e58 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -39,6 +39,3 @@ - name: INCLUDE | Vhosts configuration include: vhost.yml -# TODO: -# - Python -# - Ruby (SHIT!) diff --git a/tasks/upstream.yml b/tasks/upstream.yml index e9739ed..750703f 100644 --- a/tasks/upstream.yml +++ b/tasks/upstream.yml @@ -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