ansible-php/tasks/main.yml

45 lines
1.1 KiB
YAML

---
- name: INCLUDE_VARS | Related to OS family
include_vars: "OS_Family_{{ ansible_os_family }}.yml"
- name: INCLUDE_VARS | Related to OS version
include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"
- name: APT | Install PHP packages
apt:
pkg: "{{ item }}"
state: present
update_cache: yes
cache_valid_time: 3600
with_flattened:
- "{{ php_packages }}"
- "{{ php_extra_packages }}"
notify: restart php-fpm
when: ansible_os_family == 'Debian'
- name: PKGNG | Install PHP packages
pkgng:
name: "{{ item }}"
with_flattened:
- "{{ php_packages }}"
- "{{ php_extra_packages }}"
notify: restart php-fpm
when: ansible_os_family == 'FreeBSD'
- name: INCLUDE | PHP-FPM
include: fpm.yml
- name: LINEINFILE | PHP CLI configuration
lineinfile:
dest: '{{ php_cli_ini }}'
regexp: '^;?{{ item.key }}'
line: '{{ item.key }} = {{ item.value }}'
with_dict: "{{ php_ini | combine(php_ini_cli) }}"
- name: INCLUDE | Xdebug
include: xdebug.yml
- name: APT | Install and configure opcache
include: opcache.yml