Skip to content

Ansible role for PHP-FPM

License

Notifications You must be signed in to change notification settings

OSSHelp/ansible-phpfpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-fpm

Build Status

Role for Ansible, which installs php-fpm, php modules, generate configs from Ubuntu official repo or from ppa

Usage (example)

Common example

 - role: php-fpmphpfpm_modules: - bz2 - mysqlphpfpm_php_params: "output_buffering": "4096"phpfpm_pools: - name: test1user: nobodygroup: nogrouprequest_slowlog_timeout: 2php_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: test2user: nobodygroup: nogrouplisten: 9000max_children: 20start_servers: 3min_spare_servers: 3max_spare_servers: 10

Installation from ppa

 - role: php-fpmphpfpm_version: ppa-5.6phpfpm_modules: [ ... ]phpfpm_php_params: { ... }phpfpm_pools: [ ... ]

Configure only

 - role: php-fpmphpfpm_version: ppa-5.6phpfpm_setup: configurephpfpm_php_params: { ... }phpfpm_pools: [ ... ]

Available parameters

Main

ParamDefaultDescription
php-fpm_setupfullSetup mode. See OSSHelp KB article
phpfpm_versiondefaultSee 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_setupfalseWhether to prepare initial-setup script, ensuring the presence of necessary directories/files before the service start
phpfpm_disable_poolsfalseIf set to true, pools will be created in fpm/pool.disabled directory. Make sure to add proper post-deploy tests.

Pool parameters

ParamDefaultDescription
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_ownerwww-dataListen owner. For unix socket only
listen_groupwww-dataListen group. For unix socket only
pmdynamicChild processes management

All supported options you can see in pool template. More information about parameters in official pool example.

Misc

These parameters shouldn't be changed.

ParamDefaultDescription
phpfpm_ppappa:ondrej/phpPHP-FPM ppa
phpfpm_servicephp{{ phpfpm_version_number }}-fpmPHP-FPM service name
phpfpm_conf_dir/etc/php/{{ phpfpm_version_number }}PHP-FPM conf directory
phpfpm_pools_dir{{ phpfpm_conf_dir }}/fpm/pool.dPHP-FPM pools directory
phpfpm_php_log_dir/var/log/phpPHP logs directory
phpfpm_mail_log_path{{ phpfpm_php_log_dir }}/mail.logPHP mail() function log file

Other parameters here.

Available versions

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

FAQ

...

Useful links

TODO

  • enable/disable modules functional
  • move default pool parameters from pool.j2 to defaults

License

GPL3

Author

OSSHelp Team, see https://oss.help

close