ansible-role-php/tasks/php.yml

63 lines
1.9 KiB
YAML

---
- name: "PHP | Kopiere angepasste Konfigurationsdateien"
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "/etc/php/{{ php_version.stdout }}/mods-available/{{ item }}"
mode: 0644
loop:
- sao.ini
- sao-fpm.ini
- name: "PHP | Verlinke Apache Konfiguration"
ansible.builtin.file:
src: "/etc/php/{{ php_version.stdout }}/mods-available/sao.ini"
dest: "/etc/php/{{ php_version.stdout }}/apache2/conf.d/30-sao.ini"
state: link
when: "'libapache2-mod-php{{ php_version.stdout }}' in ansible_facts.packages"
notify: reload apache2
- name: "PHP | Verlinke cli Konfiguration"
ansible.builtin.file:
src: "/etc/php/{{ php_version.stdout }}/mods-available/sao.ini"
dest: "/etc/php/{{ php_version.stdout }}/cli/conf.d/30-sao.ini"
state: link
- name: "PHP | Erstelle Log-Verzeichnis"
ansible.builtin.file:
path: "{{ php_fpm_log_dir }}"
state: directory
mode: 0644
- name: "PHP | Verlinke FPM-Konfiguration"
ansible.builtin.file:
src: "/etc/php/{{ php_version.stdout }}/mods-available/sao-fpm.ini"
dest: "/etc/php/{{ php_version.stdout }}/fpm/conf.d/30-sao-fpm.ini"
state: link
when: "'php-fpm' in ansible_facts.packages"
notify: reload php-fpm
- name: "PHP | Kopiere Template für PHP-FPM systemd socket"
ansible.builtin.copy:
src: systemd/php-fpm@.socket
dest: /etc/systemd/system/php-fpm@.socket
mode: 0644
notify:
- stop php-fpm-socket
- stop php-fpm-service
- start php-fpm-socket
- name: "PHP | Kopiere Template für PHP-FPM systemd service"
ansible.builtin.template:
src: systemd/php-fpm@.service.j2
dest: /etc/systemd/system/php-fpm@.service
mode: 0644
notify:
- stop php-fpm-socket
- stop php-fpm-service
- start php-fpm-socket
- name: "PHP | Erstelle override-Verzeichnis"
ansible.builtin.file:
path: /etc/systemd/system/php-fpm@.service.d
state: directory
mode: 0755