2015-07-22 14:40:20 +07:00
|
|
|
---
|
2015-07-23 15:40:33 +07:00
|
|
|
|
2016-01-22 21:57:29 +07:00
|
|
|
- name: ASSERT | Check variables
|
|
|
|
assert:
|
|
|
|
that: "php_version in php_managed_versions"
|
|
|
|
|
|
|
|
- name: INCLUDE_VARS | Related to PHP version
|
|
|
|
include_vars: "php-{{ php_version }}.yml"
|
|
|
|
|
2015-07-23 15:40:33 +07:00
|
|
|
- name: APT | Install PHP packages
|
|
|
|
apt: pkg={{ item }} state=latest update_cache=yes cache_valid_time=3600
|
2015-07-23 23:10:17 +07:00
|
|
|
with_flattened:
|
2015-07-23 15:40:33 +07:00
|
|
|
- php_packages
|
|
|
|
- php_extra_packages
|
|
|
|
|
2016-01-22 21:57:29 +07:00
|
|
|
# Note: only needed for PHP5x + Xdebug
|
2015-07-27 23:09:52 +07:00
|
|
|
- name: COMMAND | Get PHP extension dir
|
|
|
|
command: php-config --extension-dir
|
|
|
|
changed_when: false
|
|
|
|
register: php_extension_dir
|
2016-01-22 21:57:29 +07:00
|
|
|
when: php_version == '5.6'
|
2015-07-27 23:09:52 +07:00
|
|
|
|
2015-07-23 15:40:33 +07:00
|
|
|
- name: INCLUDE | PHP-FPM
|
2015-07-23 22:10:15 +07:00
|
|
|
include: fpm.yml
|
2015-07-23 15:40:33 +07:00
|
|
|
when: php_install_fpm
|
|
|
|
|
2015-08-28 14:48:25 +07:00
|
|
|
- name: LINEINFILE | PHP configuration
|
2016-01-22 21:57:29 +07:00
|
|
|
lineinfile: >
|
|
|
|
dest='{{ php_etc_dir }}/cli/php.ini'
|
|
|
|
regexp='^;?{{ item.key }}'
|
|
|
|
line='{{ item.key }} = {{ item.value }}'
|
2015-08-28 14:48:25 +07:00
|
|
|
with_flattened:
|
|
|
|
- php_ini
|
|
|
|
- php_ini_cli
|
|
|
|
|
2016-01-22 21:57:29 +07:00
|
|
|
# Note: Xdebug is not packaged on PHP7.0
|
2015-07-27 23:09:52 +07:00
|
|
|
- name: INCLUDE | Xdebug
|
|
|
|
include: xdebug.yml
|
2016-01-22 21:57:29 +07:00
|
|
|
when: php_install_xdebug and php_version == 5
|
2015-07-23 15:40:33 +07:00
|
|
|
|
2016-01-22 21:57:29 +07:00
|
|
|
- name: APT | Install and configure opcache
|
|
|
|
include: opcache.yml
|
2015-07-23 15:40:33 +07:00
|
|
|
|