Introduce more variables

This commit is contained in:
phil 2023-02-25 21:25:34 +01:00
parent cfdc088844
commit 4bb9eb3870
4 changed files with 23 additions and 23 deletions

View file

@ -1,6 +1,6 @@
# {{ ansible_managed }}
#
# This service can be enabled for user.
# This service can be enabled for each user.
# It uses a single php-fpm configuration file.
# User-specific settings can be overridden via environment variables (see "FPM_SOCKET_PATH" below).
@ -11,14 +11,14 @@ After=network.target
Requires=php-fpm@%i.socket
[Service]
User=%i
Group=%i
User={{ php_fpm_user | default('%i') }}
Group={{ php_fpm_group | default('%i') }}
Type=notify
Environment="FPM_SOCKETS=/run/php/php-fpm-%i.sock=3"
Environment="FPM_ERROR_LOG={{ php_fpm_log_dir }}/%i.log"
Environment="FPM_ERROR_LOG={{ php_fpm_log_dir }}/{{ php_fpm_log_file | default('%i.log') }}"
# this variable is used in the pool configuration file
Environment="FPM_SOCKET_PATH=/run/php/php-fpm-%i.sock"
ExecStart=/usr/sbin/php-fpm{{ php_version.stdout }} --nodaemonize --fpm-config /etc/php/{{ php_version.stdout }}/fpm/pool.d/%i.cfg
ExecStart=/usr/sbin/php-fpm{{ php_version.stdout }} --nodaemonize --fpm-config {{ php_fpm_pool_config_file }}
ExecReload=/bin/kill -USR2 $MAINPID
KillMode=process
Restart=on-failure
@ -51,9 +51,9 @@ RuntimeDirectory=php
RuntimeDirectoryPreserve=yes
# Resources
CPUQuota=100%
MemoryHigh=25%
MemoryMax=35%
CPUQuota={{ php_fpm_cpu_quota }}
MemoryHigh={{ php_fpm_memory_high }}
MemoryMax={{ php_fpm_memory_max }}
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,13 @@
# {{ ansible_managed }}
[Unit]
After=network-online.target
[Socket]
SocketUser={{ php_fpm_socket_user | default('%i') }}
SocketGroup={{ php_fpm_socket_group | default('%i') }}
SocketMode=0660
ListenStream=/run/php/php-fpm-%i.sock
[Install]
WantedBy=sockets.target