32 lines
889 B
YAML

---
- name: Install PHP, PHP-FPM, and common extensions
ansible.builtin.apt:
name: "{{ httpd_php_pkgs }}"
state: present
update_cache: true
- name: Enable Apache modules for PHP-FPM
ansible.builtin.command: a2enmod {{ item }}
args:
creates: "/etc/apache2/mods-enabled/{{ item }}*"
loop: "{{ httpd_php_enabled_modules }}"
notify: Reload Apache
ignore_errors: true # in case some modules aren't available
register: httpd_php_modules_errors
- name: Ensure PHP-FPM service is running
ansible.builtin.service:
name: php{{ httpd_php_version }}-fpm
state: started
enabled: true
when: httpd_php_version is defined
- name: Deploy custom PHP-FPM pool config
ansible.builtin.template:
src: php/www.conf.j2
dest: /etc/php/{{ httpd_php_version }}/fpm/pool.d/www.conf
owner: root
group: root
mode: '0644'
notify: Restart PHP-FPM