Ansible Role - PHP Versions
Go to file
m.moraes 819bf74b1e Fix apt module loop to avoid deprecation notices
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via
squash_actions is deprecated. Instead of using a loop to supply multiple items
and specifying `name: "{{ item }}"`, please use `name: ['php5.6-common',
'php7.0-common', 'php7.1-common', 'php7.2-common', 'php7.3-common']` and remove
the loop. This feature will be removed in version 2.11. Deprecation warnings
can be disabled by setting deprecation_warnings=False in ansible.cfg.
2019-04-10 21:07:40 +00:00
defaults Fixes #27: Default to PHP 7.2, fully support PHP 7.3. 2018-12-06 15:29:10 -06:00
meta Fixes #27: Default to PHP 7.2, fully support PHP 7.3. 2018-12-06 15:29:10 -06:00
molecule/default Ansible Lint fixes. 2019-03-24 10:07:07 -05:00
tasks Fix apt module loop to avoid deprecation notices 2019-04-10 21:04:38 +00:00
vars Fix apt module loop to avoid deprecation notices 2019-04-10 21:04:38 +00:00
.ansible-lint Ansible Lint fixes. 2019-03-24 10:07:07 -05:00
.gitignore Fixes #27: Default to PHP 7.2, fully support PHP 7.3. 2018-12-06 15:29:10 -06:00
.travis.yml Fixes #27: Default to PHP 7.2, fully support PHP 7.3. 2018-12-06 15:29:10 -06:00
LICENSE Initial commit, direct port from Drupal VM. 2017-05-19 12:36:36 -05:00
README.md Fix default php_version in docs. 2018-12-06 15:49:15 -06:00

Ansible Role: PHP Versions

Build Status

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: '7.2'

The PHP version to be installed. Any currently-supported PHP major version is a valid option (e.g. 5.6, 7.1, 7.2, 7.3, etc.).

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

  vars:
    php_version: '7.2'

  roles:
    - role: 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.