ansible-role-php/tasks/main.yml

37 lines
No EOL
968 B
YAML

---
- name: "Sammle Package Fakten"
package_facts:
manager: apt
- name: "Installiere Pakete"
apt:
pkg:
- php
- php-apcu
- php-fpm
- php-zip
- name: "Ermmittle PHP-Version"
shell:
cmd: php -v | grep -Po '(?<=PHP )([0-9.]{3})'
register: php_version
changed_when: false
- name: "Kopiere angepasste Konfiguration"
template:
src: sao.ini.j2
dest: "/etc/php/{{ php_version.stdout }}/mods-available/sao.ini"
- name: "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: "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