ansible-php/tasks/main.yml

35 lines
910 B
YAML

---
- name: APT | Install PHP packages
apt: pkg={{ item }} state=latest update_cache=yes cache_valid_time=3600
with_flattened:
- php_packages
- php_extra_packages
- name: COMMAND | Get PHP extension dir
command: php-config --extension-dir
changed_when: false
register: php_extension_dir
- name: INCLUDE | PHP-FPM
include: fpm.yml
when: php_install_fpm
- name: INCLUDE | Xdebug
include: xdebug.yml
when: php_install_xdebug
- name: SHELL | Get PHP version on apt
shell: php -v | head -n 1 | awk '{ print $2 }'
register: php_apt_version
changed_when: false
- name: APT | Install and configure php-apcu / opcache (PHP 5.5+ only)
include: php55min.yml
when: php_apt_version.stdout|version_compare('5.5', 'ge', False)
- name: APT | Install and configure php-apc (PHP 5.4 max only)
include: php54max.yml
when: php_apt_version.stdout|version_compare('5.5', 'lt', False)