GithubHelp home page GithubHelp logo

ansible-role-php's Introduction

Ansible role: PHP

.github/workflows/molecule.yml

Install and configure PHP, typically for use with Drupal sites in Acro Media NGINX + FPM hosting environments.

Requirements

  • Ubuntu LTS (20.04 or newer)

Role Variables

php_default_version

  • The default CLI version of php to set on the server.
  • Defaults to 8.3

php_memory_limit

  • The default maximum memory limit
  • Applies to all php versions installed
  • Defaults to 256M.

php_max_input_vars

  • The maximum number of input vars that can be accepted in a POST request
  • Drupal typically needs this way higher than the default
  • Applies to all php versions installed
  • Defaults to 3001.

php_versions

  • A list of versions to install.
  • Defaults to [ {{php_default_version}} ].

For PHP 8.0 and before:

  • See defaults/main.yml - Up to and including PHP 8.0, the add_modules and default modules list were version-specific variables.

For PHP 8.1 and later:

php_add_modules

  • A list of extra apt packages not already included in the default list. See defaults/main.yml.
  • The modules you specify must be the full name of the apt package to install. (See example playbook below)
  • Defaults to an empty list. []

php_modules

  • Not defined by default, so the role can define it and populated it, based on the combination of php_versions and php_default_module_name_suffixes (see defaults/main.yml)
  • If you define this var in your playbook, your var will completely override the ENTIRE list of ALL modules, for ANY PHP >= 8.1 version that the role would normally install. E.g. If you have multiple versions of php installed, you'll need to specify all modules for every version yourself.

php_use_legacy_module_lists

  • Defaults to true
  • For compatibility with older playbooks that have been using the role, and have custom module specifications.
  • Setting this to false will let the role the use 8.1-style package name generator for all (older) php versions, as well as 8.1 and beyond.
  • If your role doesn't use any version specific lists (see defaults/main.yml), then it's safe to set this to false.

Dependencies

None

Example Playbook

- name: Install + Configure PHP
  hosts: servers
  gather_facts: yes
  become: yes
  vars:
    php_default_version: '8.1'
    php_versions:
      - '7.4'
      - '8.0'
      - '8.1'
    php_add_modules:
      - php7.4-foo
      - php8.0-foo
      - php8.1-foo
      - php8.1-bar
    # php_use_legacy_module_lists: ... See variable documentation.
  roles:
    - role: acromedia.php
      tags:
        - php

License

GPLv3

Author Information

Acro Media Inc. https://www.acromedia.com/

ansible-role-php's People

Contributors

chithrak07 avatar dale-c-anderson avatar jseniuk avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ansible-role-php's Issues

PPA tries to access ubuntu "sid" repository in molecule test

Which is obviously wrong. Sid is a debian version, not ubuntu. I can't tell if this is an ansible problem or a molecule problem.

The exact error presents as:

TASK [contrib/acromedia.php : Add ondrej repo to allow multiple PHP versions] ***
fatal: [instance]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: E:The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu sid Release' does not have a Release file."}

Fix molecule tests since 22.04

New docker updates have broken all molecule tests that use systemd.

See recent changes to acro's nginx, virtual host roles, or to some of geerlingguy's roles for reference.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.