cloudweeb.php

Ansible Role PHP

=========

Build Status

This Ansible role helps you install PHP. It's based on the geerlingguy.php role.

Requirements


None

Role Variables


php_version: 7.2              # Set the PHP version you want to install. Default is not set.
php_web_server_enabled: true  # Set to true if you have a web server on your server.
php_fpm_enabled: false        # Set to true if you want to enable PHP-FPM.

php_remi_repo_enabled: true   # Enable REMI repo for RHEL systems only.
php_sury_repo_enabled: true   # Enable Sury repo for Debian systems only.

php_extra_packages: []        # List additional PHP packages to install.

# php.ini configuration
php_ini_disable_functions: [] # Functions to disable in php.ini.
php_ini_expose_php: 'Off'     # Hide PHP version info.
php_ini_max_execution_time: '30' # Max execution time in seconds.
php_ini_max_input_time: '60'  # Max input time in seconds.
php_ini_max_input_vars: '2500' # Max input variables.
php_ini_memory_limit: '128M'   # Memory limit for PHP scripts.
php_ini_date_timezone: Asia/Jakarta # Default timezone.

# PHP FPM configuration
php_fpm_listen: '127.0.0.1:9000' # Address where PHP-FPM listens.
php_fpm_pm: dynamic                   # PHP-FPM process manager type.
php_fpm_pm_max_children: '50'         # Max number of child processes.
php_fpm_pm_start_servers: '5'          # Number of servers to start.
php_fpm_pm_min_spare_servers: '5'      # Min spare servers.
php_fpm_pm_max_spare_servers: '20'     # Max spare servers.
php_fpm_pm_max_requests: '4000'       # Requests per child process before respawning.
php_fpm_pm_process_idle_timeout: 10s  # Idle process kill time.

php_fpm_pools:                # List of PHP-FPM pools configuration.
  - name: www                 # PHP-FPM pool name.
    filename: www.conf        # Configuration file for the pool.
    listen: /var/run/php-fpm/php-fpm.sock # Address for the pool.
    listen_allowed_clients: '127.0.0.1'   # Allowed IPs for connection.
    env_vars: |              # Environment variables for the pool.
      env[HOSTNAME] = $HOSTNAME
      env[PATH] = /usr/local/bin:/usr/bin:/bin
      env[TMP] = /tmp
      env[TMPDIR] = /tmp
      env[TEMP] = /tmp
    extra_php_ini: |         # Additional PHP settings for the pool.
      php_admin_value[error_log] = /var/log/php-fpm/www-error.log
      php_admin_flag[log_errors] = on
      php_admin_value[memory_limit] = 128M

php_web_server_daemon: httpd  # Name of your web server (httpd, apache2, nginx).
php_fpm_daemon: php-fpm       # Name of your PHP-FPM service.

php_base_packages:            # Essential PHP packages to install.
  - php
  - php-cli
  - php-common
  - php-fpm

php_conf_file:                # Path to php.ini file.
  - /etc/php.ini

php_fpm_user: apache          # Default user for PHP-FPM.
php_fpm_group: apache         # Default group for PHP-FPM.

php_fpm_listen_owner: nobody  # Owner for PHP-FPM socket.
php_fpm_listen_group: nobody  # Group for PHP-FPM socket.

php_fpm_pool_conf_path: /etc/php-fpm.d  # Directory for PHP-FPM config.

Dependencies


None

Example Playbook


- hosts: servers
  vars:
    php_web_server_enabled: false
    php_fpm_enabled: true

    php_fpm_pools:
      - name: www
        filename: www.conf
        listen: /var/run/php-fpm/php-fpm.sock
        listen_allowed_clients: '127.0.0.1'
        env_vars: |
          env[HOSTNAME] = $HOSTNAME
          env[PATH] = /usr/local/bin:/usr/bin:/bin
          env[TMP] = /tmp
          env[TMPDIR] = /tmp
          env[TEMP] = /tmp

  roles:
    - role: cloudweeb.php

License


BSD/MIT

Author Information


Agnesius Santo Naibaho

Informazioni sul progetto

Install PHP on Linux server

Installa
ansible-galaxy install cloudweeb.php
Licenza
mit
Download
341
Proprietario