ansible-role-php/tasks/php.yml

40 lines
1.1 KiB
YAML
Raw Normal View History

---
2023-10-16 12:50:11 +02:00
- name: "PHP | Enable PHP cli configuration"
2023-01-16 15:22:30 +01:00
ansible.builtin.template:
2023-10-16 12:50:11 +02:00
src: php-cli.ini.j2
dest: "/etc/php/{{ php_version.stdout }}/cli/conf.d/30-{{ inventory_hostname }}.ini"
2023-03-17 21:55:48 +01:00
mode: "0644"
2023-10-16 12:50:11 +02:00
- name: "PHP | Enable PHP FPM configuration"
2023-02-07 17:31:59 +01:00
ansible.builtin.template:
2023-10-16 12:50:11 +02:00
src: php-fpm.ini.j2
dest: "/etc/php/{{ php_version.stdout }}/fpm/conf.d/30-{{ inventory_hostname }}.ini"
2023-03-17 21:55:48 +01:00
mode: "0644"
2023-10-16 12:50:11 +02:00
when: "'php-fpm' in ansible_facts.packages"
notify: reload php-fpm
2023-02-07 17:31:59 +01:00
- name: "PHP | Create log directory"
2023-01-16 15:22:30 +01:00
ansible.builtin.file:
path: "{{ php_fpm_log_dir }}"
state: directory
2023-03-17 21:55:48 +01:00
mode: "0755"
2023-02-25 21:25:34 +01:00
- name: "PHP | Copy template for PHP-FPM systemd service and socket"
2023-01-16 15:22:30 +01:00
ansible.builtin.template:
2023-11-01 08:08:21 +01:00
src: "systemd/{{ item }}.j2"
2023-02-25 21:25:34 +01:00
dest: "/etc/systemd/system/{{ item }}"
2023-03-17 21:55:48 +01:00
mode: "0644"
2023-02-25 21:25:34 +01:00
loop:
- php-fpm@.service
- php-fpm@.socket
notify:
- stop php-fpm-socket
- stop php-fpm-service
- start php-fpm-socket
- name: "PHP | Disable default service"
ansible.builtin.systemd:
name: "php{{ php_version.stdout }}-fpm.service"
state: stopped
enabled: false