php: Teile Tasks in einzelne Dateien auf
This commit is contained in:
parent
d81fe5f763
commit
4a7f8f212c
3 changed files with 46 additions and 37 deletions
|
@ -1,45 +1,12 @@
|
|||
---
|
||||
- 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"
|
||||
- import_tasks: packages.yml
|
||||
tags: packages
|
||||
|
||||
- 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
|
||||
|
||||
- name: "Verlinke FPM-Konfiguration"
|
||||
file:
|
||||
src: "/etc/php/{{ php_version.stdout }}/mods-available/sao.ini"
|
||||
dest: "/etc/php/{{ php_version.stdout }}/fpm/conf.d/30-sao.ini"
|
||||
state: link
|
||||
when: "'php-fpm' in ansible_facts.packages"
|
||||
notify: reload php-fpm
|
||||
- import_tasks: php.yml
|
||||
tags: php
|
||||
|
|
12
tasks/packages.yml
Normal file
12
tasks/packages.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
- name: "packages | Sammle Package Fakten"
|
||||
package_facts:
|
||||
manager: apt
|
||||
|
||||
- name: "packages | Installiere Pakete"
|
||||
apt:
|
||||
pkg:
|
||||
- php
|
||||
- php-apcu
|
||||
- php-fpm
|
||||
- php-zip
|
30
tasks/php.yml
Normal file
30
tasks/php.yml
Normal file
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
- 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 | 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
|
Loading…
Reference in a new issue