injectedMonkey.php-fpm

PHP-FPM

Build Status License GitHub release

This is an Ansible role for setting up PHP-FPM. It is made for my development setup but can also be used in production.

Supported Operating Systems:

  • Debian
  • Ubuntu

Supported PHP Versions:

  • 5.6
  • 7.0
  • 7.1

Requirements

You need Ansible version 2.4 or higher to use this role.

For configuration, we use dictionaries. To partially change the default settings, make sure to add this line in your ansible.cfg:

  hash_behaviour = merge

Or set it in your environment variables:

  ANSIBLE_HASH_BEHAVIOUR=merge

Role Variables

You can set the following variables for PHP:

  php:
    version: 7.1
    repositories:
      ppa:
        - ppa:ondrej/php
      deb:
        - { key: "https://packages.sury.org/php/apt.gpg",
            repo: "deb http://packages.sury.org/php/ {{ ansible_distribution_release }} main",
            filename: php }
    dependencies:
      - apt-transport-https
    packages:
      - cli
      - curl
      - fpm
      - intl
      - mysql
      - xml
    ini:
      fpm:
        - { section: Date, option: date.timezone, value: Europe/Berlin }
        - { section: PHP, option: max_execution_time, value: 60 }
        - { section: PHP, option: memory_limit, value: 512M }
      cli:
        - { section: Date, option: date.timezone, value: Europe/Berlin }
        - { section: PHP, option: max_execution_time, value: 0 }
        - { section: PHP, option: memory_limit, value: 512M }

Dependencies

There are no additional dependencies for this role.

Example Playbook

Here's a simple example of how to use this role in a playbook:

- hosts: servers
- include_role:
    name: injectedMonkey.php-fpm
  vars:
    php:
      version: 7.1
      repositories:
        ppa:
          - ppa:ondrej/php
        deb:
          - { key: "https://packages.sury.org/php/apt.gpg",
            repo: "deb http://packages.sury.org/php/ {{ ansible_distribution_release }} main",
            filename: php }
      dependencies:
        - apt-transport-https
      packages:
        - cli
        - curl
        - fpm
        - intl
        - mysql
        - xml
      ini:
        fpm:
          - { section: Date, option: date.timezone, value: Europe/Berlin }
          - { section: PHP, option: max_execution_time, value: 60 }
          - { section: PHP, option: memory_limit, value: 512M }
        cli:
          - { section: Date, option: date.timezone, value: Europe/Berlin }
          - { section: PHP, option: max_execution_time, value: 0 }
          - { section: PHP, option: memory_limit, value: 512M }

License

This project is licensed under the BSD license.

Author Information

Created by injectedMonkey.wtf

Informazioni sul progetto

php-fpm role for personal use.

Installa
ansible-galaxy install injectedMonkey.php-fpm
Licenza
bsd-2-clause
Download
77
Proprietario