Ansible Role - PHP Versions
Go to file
Jeff Geerling 67c11836d4 Fix lint issue with latest version of yamllint. 2023-06-14 21:22:55 -05:00
.github Fix Molecule CI workflow since docker plugin has moved. 2023-04-20 17:28:08 -05:00
defaults Add PHP 8.2 support and set it as default. 2023-02-02 21:58:02 -06:00
meta Bump default PHP version to 8.1. 2022-09-09 10:35:11 -05:00
molecule/default Fix Molecule CI workflow for Ubuntu 22.04 GitHub Actions. 2022-12-06 18:24:29 -06:00
tasks Fix lint issue with latest version of yamllint. 2023-06-14 21:22:55 -05:00
vars Deprecate PHP 7.2 support and add warnings about using it. 2021-03-18 16:33:55 -05:00
.ansible-lint Make ansible-lint work again. 2021-02-22 16:16:06 -06:00
.gitignore Fixes #27: Default to PHP 7.2, fully support PHP 7.3. 2018-12-06 15:29:10 -06:00
.yamllint Upgrade Travis CI docker version to fix Molecule tests. 2020-08-12 14:56:25 -05:00
LICENSE Initial commit, direct port from Drupal VM. 2017-05-19 12:36:36 -05:00
README.md Add PHP 8.2 support and set it as default. 2023-02-02 21:58:02 -06:00

README.md

Ansible Role: PHP Versions

CI

Allows different PHP versions to be installed when using the geerlingguy.php role (or a similar role). This role was originally built for Drupal VM but was released more generically so others could use an easier mechanism for switching PHP versions.

Requirements

N/A

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

php_version: '8.2'

The PHP version to be installed. Any currently-supported PHP major version is a valid option (e.g. 7.4, 8.0, 8.1, or 8.2).

php_versions_install_recommends: false

(For Debian OSes only) Whether to install recommended packages. This is set to no by default because setting it to yes often leads to multiple PHP versions being installed (thus making a bit of a mess) when using repos like Ondrej's PHP PPA for Ubuntu.

Dependencies

  • geerlingguy.php is a soft dependency as the php_version variable is required to be set.
  • geerlingguy.repo-remi, if you're using CentOS or a Red Hat derivative.

Example Playbook

- hosts: webservers
  become: true

  vars:
    php_version: '8.2'

  roles:
    - name: geerlingguy.repo-remi
      when: ansible_os_family == 'RedHat'
    - geerlingguy.php-versions
    - geerlingguy.php

License

MIT / BSD

Author Information

This role was created in 2017 by Jeff Geerling, author of Ansible for DevOps.