Role for Ansible, which installs php-fpm, php modules, generate configs from Ubuntu official repo or from ppa
- role: php-fpm
phpfpm_modules:
- bz2
- mysql
phpfpm_php_params:
"output_buffering": "4096"
phpfpm_pools:
- name: test1
user: nobody
group: nogroup
request_slowlog_timeout: 2
php_params:
- {name: sendmail_path, value: '/usr/sbin/sendmail -t -i -f noreply@test.com'}
- {name: log_errors, admin: true, type: flag, value: 'on'}
- {name: error_log, admin: true, value: /var/log/php/test_error.log}
- name: test2
user: nobody
group: nogroup
listen: 9000
max_children: 20
start_servers: 3
min_spare_servers: 3
max_spare_servers: 10
- role: php-fpm
phpfpm_version: ppa-5.6
phpfpm_modules: [ ... ]
phpfpm_php_params: { ... }
phpfpm_pools: [ ... ]
- role: php-fpm
phpfpm_version: ppa-5.6
phpfpm_setup: configure
phpfpm_php_params: { ... }
phpfpm_pools: [ ... ]
Param | Default | Description |
---|---|---|
php-fpm_setup |
full |
Setup mode. See OSSHelp KB article |
phpfpm_version |
default |
See version list bellow |
phpfpm_modules |
[] |
List of PHP modules |
phpfpm_php_params |
{} |
List of global PHP parameters |
phpfpm_pools |
[] |
List of php-fpm pools |
phpfpm_initial_setup |
false |
Whether to prepare initial-setup script, ensuring the presence of necessary directories/files before the service start |
phpfpm_disable_pools |
false |
If set to true , pools will be created in fpm/pool.disabled directory. Make sure to add proper post-deploy tests. |
Param | Default | Description |
---|---|---|
name |
- | Pool name |
user |
- | Pool user |
listen |
'/run/php/php' ~ phpfpm_version_number ~ '-fpm_' ~ pool.name ~ '.sock' |
Listen. Unix socket path or tcp addr:port |
listen_owner |
www-data |
Listen owner. For unix socket only |
listen_group |
www-data |
Listen group. For unix socket only |
pm |
dynamic |
Child processes management |
All supported options you can see in pool template. More information about parameters in official pool example.
These parameters shouldn't be changed.
Param | Default | Description |
---|---|---|
phpfpm_ppa |
ppa:ondrej/php |
PHP-FPM ppa |
phpfpm_service |
php{{ phpfpm_version_number }}-fpm |
PHP-FPM service name |
phpfpm_conf_dir |
/etc/php/{{ phpfpm_version_number }} |
PHP-FPM conf directory |
phpfpm_pools_dir |
{{ phpfpm_conf_dir }}/fpm/pool.d |
PHP-FPM pools directory |
phpfpm_php_log_dir |
/var/log/php |
PHP logs directory |
phpfpm_mail_log_path |
{{ phpfpm_php_log_dir }}/mail.log |
PHP mail() function log file |
Other parameters here.
Versions from ppa only avalaible for bionic and focal!
- default
- ppa-5.6
- ppa-7.0
- ppa-7.1
- ppa-7.2
- ppa-7.3
- ppa-7.4
- ppa-8.0
...
- enable/disable modules functional
- move default pool parameters from pool.j2 to defaults
GPL3
OSSHelp Team, see https://oss.help