From 51d94d1ca5daf2a97a3480ab40ac5e505cbc2d1c Mon Sep 17 00:00:00 2001 From: phil Date: Sat, 12 Jun 2021 19:39:41 +0200 Subject: [PATCH] Verschiebe php-Kram in extra Rolle --- defaults/main.yml | 2 ++ handlers/main.yml | 6 ++++++ meta/main.yml | 10 ++++++++++ tasks/main.yml | 18 ++++++++++++++++++ templates/30-sao.ini.j2 | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 72 insertions(+) create mode 100644 defaults/main.yml create mode 100644 handlers/main.yml create mode 100644 meta/main.yml create mode 100644 tasks/main.yml create mode 100644 templates/30-sao.ini.j2 diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..a91c7f7 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +php_version: 7.3 diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..c4cdb57 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,6 @@ +--- + +- name: reload apache2 + service: + name: apache2 + state: reloaded diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..aa117b2 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,10 @@ +galaxy_info: + author: systemausfall.org + description: Role to install PHP + company: Sense.Lab e.V. + license: GPLv3 + min_ansible_version: 2.1 + platforms: + - name: Debian + versions: + - Buster diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..c00d68c --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,18 @@ +--- +- name: "Sammle Package Fakten" + package_facts: + manager: apt + +- name: "Installiere Pakete" + apt: + pkg: + - php-apcu + - php-fpm + - php-zip + +- name: "Kopiere Konfiguration" + template: + src: 30-sao.ini.j2 + dest: "/etc/php/{{ php_version }}/apache2e2/conf.d/30-sao.ini" + when: "'apache2' in ansible_facts.packages" + notify: reload apache2 diff --git a/templates/30-sao.ini.j2 b/templates/30-sao.ini.j2 new file mode 100644 index 0000000..abcd7db --- /dev/null +++ b/templates/30-sao.ini.j2 @@ -0,0 +1,36 @@ +{% if inventory_hostname == "wwwusers-ng.sao" %} +file_uploads = on +max_execution_time=120 +max_input_time=120 +post_max_size=16M +upload_max_filesize=16M +SMTP=mail-postfix.sao +{% else %} +upload_max_filesize = 15M +post_max_size = 15M +memory_limit = 192M +max_execution_time = 300 +{% endif %} + +date.timezone = Europe/Berlin +default_charset = "UTF-8" + +;Upload-Fortschritt +apc.rfc1867 = 1 + +{% if inventory_hostname == "webmail-horde.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,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 %} +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 %} + +error_log = /var/log/php.log +display_errors = Off + +;Empfohlene Einstellungen (pcc) +allow_url_fopen = Off +assert.active = Off +mail.add_x_header = Off +session.use_strict_mode = 1