Ansible Role - PHP Versions
Go to file
2024-10-11 08:54:21 +07:00
.github Fixup CI versions. Drop all older RHEL releases which are broken. 2024-07-16 14:23:06 -05:00
defaults fix: require user confirmation to delete other php version in Debian 2024-10-11 08:54:21 +07:00
meta Remove official support for RHEL. Rocky/Alma/Stream support is best-effort. 2023-06-23 10:57:17 -05:00
molecule/default Fixup CI versions. Drop all older RHEL releases which are broken. 2024-07-16 14:23:06 -05:00
tasks fix: require user confirmation to delete other php version in Debian 2024-10-11 08:54:21 +07:00
vars Issue #90: PHP 8.3 support. 2024-07-04 21:57:14 -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 Stale bot is now Stale GitHub Action. 2023-07-10 17:48:36 -05:00
LICENSE Initial commit, direct port from Drupal VM. 2017-05-19 12:36:36 -05:00
README.md Issue #90: PHP 8.3 support. 2024-07-04 21:57:14 -05:00

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.3'

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

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.3'

  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.