42 lines
1008 B
YAML
42 lines
1008 B
YAML
---
|
|
|
|
- name: INCLUDE_VARS | Related to OS
|
|
include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
|
|
|
- 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 }}"
|
|
notify: restart php-fpm
|
|
|
|
- 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_dict: "{{ php_ini_cli }}"
|
|
|
|
- name: INCLUDE | Xdebug
|
|
include: xdebug.yml
|
|
when: php_install_xdebug
|
|
|
|
- name: APT | Install and configure opcache
|
|
include: opcache.yml
|
|
|