geerlingguy.php-versions

Ansible Role: PHP Versions

CI

This role allows you to install different versions of PHP when using the geerlingguy.php role (or similar roles). It was initially made for Drupal VM but is now available for everyone to use for easily switching PHP versions.

Requirements

None

Role Variables

Here are the available variables along with their default values (see defaults/main.yml):

  • php_version: '8.3'
    This sets the PHP version to be installed. You can choose any currently supported major version of PHP (like 7.4, 8.1, 8.2, or 8.3).

  • php_versions_install_recommends: false
    (For Debian operating systems only) This determines whether to install recommended packages. It's set to no by default, as setting it to yes can cause multiple PHP versions to be installed, which can create confusion, especially when using repositories like Ondrej's PHP PPA for Ubuntu.

Dependencies

  • The geerlingguy.php role is a soft dependency since the php_version variable needs to be set.
  • The geerlingguy.repo-remi role is needed if you're on CentOS or a similar Red Hat-based system.

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, who is also the author of Ansible for DevOps.

Informazioni sul progetto

Allows different PHP versions to be installed.

Installa
ansible-galaxy install geerlingguy.php-versions
Licenza
mit
Download
1.1M
Proprietario
Father, author, developer, maker. Sometimes called "an inflammatory enigma". #stl #drupal #ansible #k8s #raspberrypi #crohns