40 lines
886 B
YAML
40 lines
886 B
YAML
---
|
|
|
|
- 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"
|
|
|
|
- name: APT | Update cache
|
|
apt: update_cache=yes cache_valid_time=3600
|
|
changed_when: false
|
|
|
|
- name: APT | Install PHP packages
|
|
apt: pkg={{ item }} state=present
|
|
with_flattened:
|
|
- "{{ php_packages }}"
|
|
- "{{ php_extra_packages }}"
|
|
|
|
- name: INCLUDE | PHP-FPM
|
|
include: fpm.yml
|
|
when: php_install_fpm
|
|
|
|
- name: LINEINFILE | PHP configuration
|
|
lineinfile: >
|
|
dest='{{ php_etc_dir }}/cli/php.ini'
|
|
regexp='^;?{{ item.key }}'
|
|
line='{{ item.key }} = {{ item.value }}'
|
|
with_flattened:
|
|
- "{{ php_ini }}"
|
|
- "{{ php_ini_cli }}"
|
|
|
|
- name: INCLUDE | Xdebug
|
|
include: xdebug.yml
|
|
when: php_install_xdebug
|
|
|
|
- name: APT | Install and configure opcache
|
|
include: opcache.yml
|
|
|