roles/php5-fpm: Use template for pools

Each vhost has a separate pool.

Signed-off-by: Alan Orth <alan.orth@gmail.com>
This commit is contained in:
Alan Orth 2014-08-27 19:48:21 +03:00
parent 2afa1ef2f3
commit 0689153bd9
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
2 changed files with 8 additions and 5 deletions

View File

@ -10,7 +10,8 @@
tags: php5-fpm
- name: Copy php5-fpm pool config
copy: src=www.conf dest=/etc/php5/fpm/pool.d/www.conf owner=root group=root mode=0644
template: src=pool.conf.j2 dest=/etc/php5/fpm/pool.d/{{ item.nginx_domain_name }}.conf owner=root group=root mode=0644
with_items: nginx_vhosts
notify: restart php5-fpm
tags: php5-fpm

View File

@ -1,7 +1,9 @@
; Start a new pool named 'www'.
{% set domain_name = item.nginx_domain_name %}
; Start a new pool named '{{ domain_name }}'.
; the variable $pool can we used in any directive and will be replaced by the
; pool name ('www' here)
[www]
; pool name ('{{ domain_name }}' here)
[{{ domain_name }}]
; Per pool prefix
; It only applies on the following directives:
@ -30,7 +32,7 @@ group = nginx
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = /var/run/php5-fpm.sock
listen = /var/run/php5-fpm-{{ domain_name }}.sock
; Set listen(2) backlog.
; Default Value: 65535 (-1 on FreeBSD and OpenBSD)