debops.php5

This role can be used as a dependency of other roles to easily enable support for PHP5 on a host. php5-fpm package will be used as a backend for PHP5 applications. This role works very well with debops.nginx role for setting up nginx webserver as a frontend.

Installation

This role requires at least Ansible v1.7.0. To install it, run:

ansible-galaxy install debops.php5

Role variables

List of default variables available in the inventory:

---

# Install set of standard packages
php5_packages: [ 'php5-curl', 'php5-gd', 'php5-mcrypt' ]

# This variable determines what options will be used in php.ini for options
# that can be useful either in production or development environment
php5_production: True

# Default values for several global PHP5 options
php5_post_max_size: '8M'
php5_default_charset: 'UTF-8'
php5_file_uploads: 'On'
php5_upload_max_filesize: '{{ php5_post_max_size }}'
php5_max_file_uploads: 20
php5_allow_url_fopen: 'On'

# Default values used in pools when pool has none set
php5_default_pm: 'ondemand'
php5_default_pm_max_children: 5
php5_default_pm_min_spare_servers: 1
php5_default_pm_max_spare_servers: 3
php5_default_pm_start_servers: 2
php5_default_pm_process_idle_timeout: '30s'
php5_default_pm_max_requests: 500
php5_default_pm_status: False
php5_default_pm_status_path: '/php5_status'
php5_default_ping_path: '/php5_ping'
php5_default_ping_response: 'pong'
php5_default_rlimit_files: 1024
php5_default_rlimit_core: 0

# Should php5 role manage server pools?
php5_manage_pools: True

# List of managed pools
php5_pools: [ '{{ php5_pool_default }}' ]

# Default PHP5-FPM pool for www-data, explanation of variables can be found
# in templates/etc/php5/fpm/pool-available.d/pool.conf.j2
# Everything commented out is optional.
php5_pool_default:
  enabled: True
  name: 'www-data'

  #prefix: ''

  #user: 'www-data'
  #group: 'www-data'

  #listen: '/var/run/php5-fpm-www-data.sock'

  # pm: static, dynamic, ondemand
  #pm: 'ondemand'

  # Settings for all management types
  #pm_max_children: 5

  # Settings for 'dynamic' process management
  #pm_min_spare_servers: 1
  #pm_max_spare_servers: 3
  #pm_start_servers: 2

  # Settings for 'ondemand' process management
  #pm_process_idle_timeout: '30s'

  #pm_max_requests: 500

  #pm_status: True
  #pm_status_path: '{{ php5_default_pm_status_path }}'
  #ping_path: '{{ php5_default_ping_path }}'
  #ping_response: '{{ php5_default_ping_response }}'

  #accesslog: True

  #request_slowlog_timeout: '30s'

  #request_terminate_timeout: '5m'

  #rlimit_files: 1024
  #rlimit_core: 0

  #chroot: ''
  #chdir: '/'

  #catch_workers_output: False

  #security_limit_extensions: '.php'

  #environment:
  #  HOSTNAME: '$HOSTNAME'
  #  PATH: '/usr/local/bin:/usr/bin:/bin'
  #  TMP: '/tmp'
  #  TMPDIR: '/tmp'
  #  TEMP: '/tmp'

  #php_flag:
  #  display_errors: 'off'

  #php_value:
  #  default_mimetype: 'text/html'

  #php_admin_flag:
  #  log_errors: 'on'

  #php_admin_value:
  #  memory_limit: '32M'

  #open_basedir: '/usr/share/php5:/tmp'

Authors and license

debops.php5 role was written by:

License: GPLv3