ansible-php/tasks/opcache.yml

47 lines
1.1 KiB
YAML

---
- name: Install opcache/apcu on Debian
when: ansible_os_family == 'Debian'
block:
- name: APT | Install APCu
ansible.builtin.apt:
pkg: "{{ php_apcu_package }}"
install_recommends: false
- name: APT | Install Opcache
ansible.builtin.apt:
pkg: "{{ php_package_prefix }}opcache"
install_recommends: false
- name: Install opcache/apcu on FreeBSD
when: ansible_os_family == 'FreeBSD'
block:
- name: PKGNG | Install APCu
community.general.pkgng:
name: "php{{ php_version | replace('.', '') }}-pecl-APCu"
- name: PKGNG | Install Opcache
community.general.pkgng:
name: "{{ php_package_prefix }}opcache"
- name: TEMPLATE | Configure Opcache
ansible.builtin.template:
src: "etc/__php__/mods-available/opcache.ini.j2"
dest: "{{ php_mods_dir }}/opcache.ini"
owner: root
group: root
mode: 0644
notify: Restart php-fpm
- name: TEMPLATE | Configure APCu
ansible.builtin.template:
src: "etc/__php__/mods-available/apcu.ini.j2"
dest: "{{ php_mods_dir }}/apcu.ini"
owner: root
group: root
mode: 0644
notify: Restart php-fpm