ansible-role-php/tasks/php.yml

54 lines
1.6 KiB
YAML
Raw Normal View History

---
- name: "php | Kopiere angepasste Konfigurationsdateien"
template:
src: "{{ item }}.j2"
dest: "/etc/php/{{ php_version.stdout }}/mods-available/{{ item }}"
loop:
- sao.ini
- sao-fpm.ini
- name: "php | Verlinke Apache Konfiguration"
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"
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"
file:
path: "{{ php_fpm_log_dir }}"
state: directory
- name: "php | Verlinke FPM-Konfiguration"
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"
copy:
src: systemd/php-fpm@.socket
dest: /etc/systemd/system/php-fpm@.socket
notify:
- stop php-fpm-socket
- stop php-fpm-service
- start php-fpm-socket
- name: "php | Kopiere Template für PHP-FPM systemd service"
template:
src: systemd/php-fpm@.service.j2
dest: /etc/systemd/system/php-fpm@.service
notify:
- stop php-fpm-socket
- stop php-fpm-service
- start php-fpm-socket