2022-06-09 15:15:49 +02:00
|
|
|
---
|
2023-02-07 17:31:59 +01:00
|
|
|
- name: "PHP | Copy custom PHP configuration"
|
2023-01-16 15:22:30 +01:00
|
|
|
ansible.builtin.template:
|
2023-02-07 17:31:59 +01:00
|
|
|
src: php.ini
|
|
|
|
dest: "/etc/php/{{ php_version.stdout }}/mods-available/{{ inventory_hostname }}.ini"
|
2023-01-16 15:22:30 +01:00
|
|
|
mode: 0644
|
2022-06-09 15:15:49 +02:00
|
|
|
|
2023-02-07 17:31:59 +01:00
|
|
|
- name: "PHP | Copy custom PHP-FPM configuration"
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: php-fpm.ini
|
|
|
|
dest: "/etc/php/{{ php_version.stdout }}/mods-available/{{ inventory_hostname }}-fpm.ini"
|
|
|
|
mode: 0644
|
|
|
|
|
|
|
|
- name: "PHP | Enable PHP configuration for mod_php"
|
2023-01-16 15:22:30 +01:00
|
|
|
ansible.builtin.file:
|
2023-02-07 17:31:59 +01:00
|
|
|
src: "/etc/php/{{ php_version.stdout }}/mods-available/{{ inventory_hostname }}.ini"
|
|
|
|
dest: "/etc/php/{{ php_version.stdout }}/apache2/conf.d/30-{{ inventory_hostname }}.ini"
|
2022-06-09 15:15:49 +02:00
|
|
|
state: link
|
|
|
|
when: "'libapache2-mod-php{{ php_version.stdout }}' in ansible_facts.packages"
|
|
|
|
notify: reload apache2
|
|
|
|
|
2023-02-07 17:31:59 +01:00
|
|
|
- name: "PHP | Enable PHP cli configuration"
|
2023-01-16 15:22:30 +01:00
|
|
|
ansible.builtin.file:
|
2023-02-07 17:31:59 +01:00
|
|
|
src: "/etc/php/{{ php_version.stdout }}/mods-available/{{ inventory_hostname }}.ini"
|
|
|
|
dest: "/etc/php/{{ php_version.stdout }}/cli/conf.d/30-{{ inventory_hostname }}.ini"
|
2022-06-09 15:15:49 +02:00
|
|
|
state: link
|
|
|
|
|
2023-02-07 17:31:59 +01:00
|
|
|
- name: "PHP | Create log directory"
|
2023-01-16 15:22:30 +01:00
|
|
|
ansible.builtin.file:
|
2022-08-18 08:40:39 +02:00
|
|
|
path: "{{ php_fpm_log_dir }}"
|
|
|
|
state: directory
|
2023-01-16 22:30:35 +01:00
|
|
|
mode: 0755
|
2022-08-18 08:40:39 +02:00
|
|
|
|
2023-02-07 17:31:59 +01:00
|
|
|
- name: "PHP | Enable PGP FPM configuration"
|
2023-01-16 15:22:30 +01:00
|
|
|
ansible.builtin.file:
|
2023-02-07 17:31:59 +01:00
|
|
|
src: "/etc/php/{{ php_version.stdout }}/mods-available/{{ inventory_hostname }}-fpm.ini"
|
|
|
|
dest: "/etc/php/{{ php_version.stdout }}/fpm/conf.d/30-{{ inventory_hostname }}-fpm.ini"
|
2022-06-09 15:15:49 +02:00
|
|
|
state: link
|
|
|
|
when: "'php-fpm' in ansible_facts.packages"
|
|
|
|
notify: reload php-fpm
|
2022-08-18 08:40:39 +02:00
|
|
|
|
2023-02-07 17:31:59 +01:00
|
|
|
- name: "PHP | Copy template for PHP-FPM systemd socket"
|
2023-01-16 15:22:30 +01:00
|
|
|
ansible.builtin.copy:
|
2022-08-18 08:40:39 +02:00
|
|
|
src: systemd/php-fpm@.socket
|
|
|
|
dest: /etc/systemd/system/php-fpm@.socket
|
2023-01-16 15:22:30 +01:00
|
|
|
mode: 0644
|
2022-08-18 08:40:39 +02:00
|
|
|
notify:
|
|
|
|
- stop php-fpm-socket
|
|
|
|
- stop php-fpm-service
|
|
|
|
- start php-fpm-socket
|
|
|
|
|
2023-02-07 17:31:59 +01:00
|
|
|
- name: "PHP | Copy template for PHP-FPM systemd service"
|
2023-01-16 15:22:30 +01:00
|
|
|
ansible.builtin.template:
|
2023-02-07 17:31:59 +01:00
|
|
|
src: systemd/php-fpm@.service
|
2022-08-18 08:40:39 +02:00
|
|
|
dest: /etc/systemd/system/php-fpm@.service
|
2023-01-16 15:22:30 +01:00
|
|
|
mode: 0644
|
2022-08-18 08:40:39 +02:00
|
|
|
notify:
|
|
|
|
- stop php-fpm-socket
|
|
|
|
- stop php-fpm-service
|
|
|
|
- start php-fpm-socket
|
2023-01-16 15:24:09 +01:00
|
|
|
|
2023-02-07 17:31:59 +01:00
|
|
|
- name: "PHP | Create systemd override directory"
|
2023-01-16 15:24:09 +01:00
|
|
|
ansible.builtin.file:
|
|
|
|
path: /etc/systemd/system/php-fpm@.service.d
|
|
|
|
state: directory
|
|
|
|
mode: 0755
|