Erstelle php-playbook, Passe Rolle an

This commit is contained in:
phil 2022-01-14 23:32:15 +01:00
parent fa45f23f5e
commit 700457660c
5 changed files with 30 additions and 13 deletions

View file

@ -1,2 +1 @@
---
php_version: 7.3
---

View file

@ -1,6 +1,5 @@
---
- name: reload apache2
service:
name: apache2
state: reloaded
state: reloaded

View file

@ -3,8 +3,8 @@ galaxy_info:
description: Role to install PHP
company: Sense.Lab e.V.
license: GPLv3
min_ansible_version: 2.1
min_ansible_version: 2.9
platforms:
- name: Debian
versions:
- Buster
- Bullseye

View file

@ -6,13 +6,32 @@
- name: "Installiere Pakete"
apt:
pkg:
- php
- php-apcu
- php-fpm
- php-zip
- name: "Kopiere Konfiguration"
- 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: 30-sao.ini.j2
dest: "/etc/php/{{ php_version }}/apache2/conf.d/30-sao.ini"
when: "'apache2' in ansible_facts.packages"
notify: reload apache2
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

View file

@ -22,7 +22,7 @@ apc.rfc1867 = 1
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_exec,passthru,system,proc_get_status,proc_close,proc_nice,proc_terminate,proc_open,curl_ini,parse_ini_file,show_source,dl,symlink,mail,system_exec,exec,shell_exec,phpinfo
{% elif inventory_hostname == "wwwusers-ng.sao" %}
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_exec,passthru,system,proc_get_status,proc_close,proc_nice,proc_terminate,proc_open,curl_ini,show_source,dl,symlink,system_exec,exec,shell_exec,phpinfo
{% else %}
{% elif inventory_hostname == "kameradisten.ramus" %}
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_exec,passthru,system,proc_get_status,proc_close,proc_nice,proc_terminate,proc_open,curl_ini,parse_ini_file,show_source,dl,symlink,system_exec,exec,shell_exec,phpinfo
{% endif %}
@ -33,4 +33,4 @@ display_errors = Off
allow_url_fopen = Off
assert.active = Off
mail.add_x_header = Off
session.use_strict_mode = 1
session.use_strict_mode = 1