2018-08-07 20:53:28 +00:00
|
|
|
; {{ ansible_managed }}
|
|
|
|
{% for pool in phpfpm_pools %}
|
|
|
|
|
|
|
|
[{{ pool.name }}]
|
|
|
|
|
|
|
|
user = {{ pool.user }}
|
2018-08-15 07:30:18 +00:00
|
|
|
group = users
|
2018-08-07 20:53:28 +00:00
|
|
|
|
|
|
|
listen = /var/run/php{{ phpfpm_version }}-fpm-{{ pool.name }}.sock
|
|
|
|
listen.owner = {{ pool.user }}
|
2018-08-23 19:07:25 +00:00
|
|
|
listen.group = {{ pool.group|default(pool.user) }}
|
2018-08-07 20:53:28 +00:00
|
|
|
|
|
|
|
pm = {{ pool.pm|default(phpfpm_pm) }}
|
|
|
|
pm.max_children = {{ pool.pm_max_children|default(phpfpm_pm_max_children) }}
|
|
|
|
{% if pool.pm is defined and pool.pm in ['ondemand', 'dynamic'] or phpfpm_pm in ['static', 'dynamic'] %}
|
|
|
|
pm.start_servers = {{ pool.pm_start_servers|default(phpfpm_pm_start_servers) }}
|
|
|
|
{% endif %}
|
|
|
|
{% if pool.pm is defined and pool.pm == 'dynamic' or phpfpm_pm == 'dynamic' %}
|
|
|
|
pm.min_spare_servers = {{ pool.pm_min_spare_servers|default(phpfpm_pm_min_spare_servers) }}
|
|
|
|
pm.max_spare_servers = {{ pool.pm_max_spare_servers|default(phpfpm_pm_max_spare_servers) }}
|
|
|
|
{% endif %}
|
|
|
|
pm.max_requests = {{ pool.pm_max_requests|default(phpfpm_pm_max_requests) }}
|
|
|
|
pm.process_idle_timeout = {{ pool.pm_process_idle_timeout|default(phpfpm_pm_process_idle_timeout) }}s
|
|
|
|
pm.status_path = {{ pool.pm_status_path|default(phpfpm_pm_status_path) }}
|
|
|
|
|
|
|
|
ping.path = {{ pool.ping_path|default(phpfpm_ping_path) }}
|
|
|
|
ping.response = {{ pool.ping_response|default(phpfpm_ping_response) }}
|
|
|
|
|
|
|
|
access.log = {{ phpfpm_dir_log }}/{{ pool.name }}.access.log
|
|
|
|
access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
|
|
|
|
|
|
|
|
slowlog = {{ phpfpm_dir_log }}/{{ pool.name }}.slow.log
|
|
|
|
request_slowlog_timeout = {{ pool.request_slowlog_timeout|default(phpfpm_request_slowlog_timeout) }}
|
|
|
|
|
|
|
|
catch_workers_output = no
|
|
|
|
|
|
|
|
security.limit_extensions = {{ pool.security_limit_extensions|default(phpfpm_security_limit_extensions) }}
|
|
|
|
|
|
|
|
clear_env = yes
|
|
|
|
env[HOSTNAME] = $HOSTNAME
|
|
|
|
{% if pool.php_config is defined %}
|
|
|
|
{% for type, options in pool.php_config.iteritems() %}
|
|
|
|
{% for option, value in options.iteritems() %}
|
|
|
|
php_{{ type }}[{{ option }}] = {{ value }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|