first version
This commit is contained in:
parent
5f33777b80
commit
8e9af2f3e5
20 changed files with 2740 additions and 0 deletions
10
templates/logrotate.j2
Normal file
10
templates/logrotate.j2
Normal file
|
@ -0,0 +1,10 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
{{ phpfpm_dir_log}}/*.log {
|
||||
{% for option in phpfpm_logrotate_options %}
|
||||
{{ option }}
|
||||
{% endfor %}
|
||||
postrotate
|
||||
/usr/lib/php/php{{ phpfpm_version }}-fpm-reopenlogs
|
||||
endscript
|
||||
}
|
20
templates/php-fpm.conf.j2
Normal file
20
templates/php-fpm.conf.j2
Normal file
|
@ -0,0 +1,20 @@
|
|||
; {{ ansible_managed }}
|
||||
|
||||
[global]
|
||||
|
||||
error_log = {{ phpfpm_dir_log }}/php-fpm.log
|
||||
syslog.facility = daemon
|
||||
syslog.ident = php-fpm
|
||||
log_level = notice
|
||||
|
||||
emergency_restart_threshold = 0
|
||||
emergency_restart_interval = 0
|
||||
|
||||
process_control_timeout = 0
|
||||
process.max = 0
|
||||
|
||||
daemonize = yes
|
||||
rlimit_core = 0
|
||||
systemd_interval = 10
|
||||
|
||||
include = {{ phpfpm_dir }}/pools.conf
|
48
templates/pools.conf.j2
Normal file
48
templates/pools.conf.j2
Normal file
|
@ -0,0 +1,48 @@
|
|||
; {{ ansible_managed }}
|
||||
{% for pool in phpfpm_pools %}
|
||||
|
||||
[{{ pool.name }}]
|
||||
|
||||
user = {{ pool.user }}
|
||||
group = {{ pool.group|default(phpfpm_group) }}
|
||||
|
||||
listen = /var/run/php{{ phpfpm_version }}-fpm-{{ pool.name }}.sock
|
||||
listen.owner = {{ pool.user }}
|
||||
listen.group = {{ pool.group|default(phpfpm_group) }}
|
||||
|
||||
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 %}
|
Loading…
Add table
Add a link
Reference in a new issue