mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
www_options/tasks/set-php-limits.yml run on demand (by 5 roles)
This commit is contained in:
parent
7882dcb7f8
commit
81004687c8
12 changed files with 216 additions and 86 deletions
|
@ -2,6 +2,7 @@
|
||||||
# Version 3 of the GNU General Public License. We modified this code and applied it here in April 2022. The derived sections correspond to the tasks running
|
# Version 3 of the GNU General Public License. We modified this code and applied it here in April 2022. The derived sections correspond to the tasks running
|
||||||
# from "HTTP Get Welcome" through "Finish Matomo Setup", lines 45 through 156.
|
# from "HTTP Get Welcome" through "Finish Matomo Setup", lines 45 through 156.
|
||||||
|
|
||||||
|
|
||||||
- name: "WARNING: './runrole --reinstall matomo' CAN FAIL AS OF 2022-06-15, e.g. if /library/www/matomo already exists"
|
- name: "WARNING: './runrole --reinstall matomo' CAN FAIL AS OF 2022-06-15, e.g. if /library/www/matomo already exists"
|
||||||
meta: noop
|
meta: noop
|
||||||
|
|
||||||
|
@ -10,6 +11,12 @@
|
||||||
# TASK [matomo : HTTP Get Welcome] ***************************************************************************************************************************************
|
# TASK [matomo : HTTP Get Welcome] ***************************************************************************************************************************************
|
||||||
# fatal: [127.0.0.1]: FAILED! => {"cache_control": "private, no-cache, no-store", "changed": false, "connection": "close", "content_type": "text/html; charset=utf-8", "date": "Wed, 15 Jun 2022 05:07:41 GMT", "elapsed": 0, "expires": "Thu, 19 Nov 1981 08:52:00 GMT", "msg": "Status code was 500 and not [200]: HTTP Error 500: Internal Server Error", "pragma": "no-cache", "redirected": false, "server": "nginx/1.18.0 (Ubuntu)", "set_cookie": "MATOMO_SESSID=psak3aem27vrdrt8t2f016600f; path=/; HttpOnly; SameSite=Lax", "status": 500, "transfer_encoding": "chunked", "url": "http://box.lan/matomo/index.php?action=welcome", "x_matomo_request_id": "fbfd2"}
|
# fatal: [127.0.0.1]: FAILED! => {"cache_control": "private, no-cache, no-store", "changed": false, "connection": "close", "content_type": "text/html; charset=utf-8", "date": "Wed, 15 Jun 2022 05:07:41 GMT", "elapsed": 0, "expires": "Thu, 19 Nov 1981 08:52:00 GMT", "msg": "Status code was 500 and not [200]: HTTP Error 500: Internal Server Error", "pragma": "no-cache", "redirected": false, "server": "nginx/1.18.0 (Ubuntu)", "set_cookie": "MATOMO_SESSID=psak3aem27vrdrt8t2f016600f; path=/; HttpOnly; SameSite=Lax", "status": 500, "transfer_encoding": "chunked", "url": "http://box.lan/matomo/index.php?action=welcome", "x_matomo_request_id": "fbfd2"}
|
||||||
|
|
||||||
|
|
||||||
|
- name: "Run roles/www_options/tasks/set-php-limits.yml with 'nginx_high_php_limits: False' by default"
|
||||||
|
include_tasks: roles/www_options/tasks/set-php-limits.yml
|
||||||
|
when: set_php_limits is undefined
|
||||||
|
|
||||||
|
|
||||||
- name: Start MariaDB
|
- name: Start MariaDB
|
||||||
#action: service name=mysql state=started
|
#action: service name=mysql state=started
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -17,6 +17,11 @@
|
||||||
name: postgresql
|
name: postgresql
|
||||||
|
|
||||||
|
|
||||||
|
- name: "Run roles/www_options/tasks/set-php-limits.yml with 'nginx_high_php_limits: True' by default"
|
||||||
|
include_tasks: roles/www_options/tasks/set-php-limits.yml
|
||||||
|
when: set_php_limits is undefined
|
||||||
|
|
||||||
|
|
||||||
# 2021-07-02: Let's monitor & learn from these 2 pages year-by-year:
|
# 2021-07-02: Let's monitor & learn from these 2 pages year-by-year:
|
||||||
# https://docs.moodle.org/19/en/PHP_settings_by_Moodle_version#PHP_Extensions_and_libraries
|
# https://docs.moodle.org/19/en/PHP_settings_by_Moodle_version#PHP_Extensions_and_libraries
|
||||||
# https://github.com/moodlebox/moodlebox/blob/master/roles/packages/vars/main.yml
|
# https://github.com/moodlebox/moodlebox/blob/master/roles/packages/vars/main.yml
|
||||||
|
|
|
@ -40,6 +40,11 @@
|
||||||
# var: php_new
|
# var: php_new
|
||||||
|
|
||||||
|
|
||||||
|
- name: "Run roles/www_options/tasks/set-php-limits.yml with 'nginx_high_php_limits: False' by default"
|
||||||
|
include_tasks: roles/www_options/tasks/set-php-limits.yml
|
||||||
|
when: set_php_limits is undefined
|
||||||
|
|
||||||
|
|
||||||
# February 2020: See @m-anish's PR #2119 and follow-up PR #2258.
|
# February 2020: See @m-anish's PR #2119 and follow-up PR #2258.
|
||||||
# 2021-07-06: If you're running Nextcloud 22+ in production, carefully check the latest required AND recommended prereqs:
|
# 2021-07-06: If you're running Nextcloud 22+ in production, carefully check the latest required AND recommended prereqs:
|
||||||
# https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
|
# https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
# https://github.com/iiab/iiab/tree/master/roles/pbx#readme
|
# https://github.com/iiab/iiab/tree/master/roles/pbx#readme
|
||||||
|
|
||||||
|
|
||||||
|
- name: "Run roles/www_options/tasks/set-php-limits.yml with 'nginx_high_php_limits: False' by default"
|
||||||
|
include_tasks: roles/www_options/tasks/set-php-limits.yml
|
||||||
|
when: set_php_limits is undefined
|
||||||
|
|
||||||
|
|
||||||
# 2021-08-04: Non-native systemd service 'asterisk.service' (redirects via
|
# 2021-08-04: Non-native systemd service 'asterisk.service' (redirects via
|
||||||
# systemd-sysv-install, to '/etc/init.d/asterisk status' etc) is Enabled but
|
# systemd-sysv-install, to '/etc/init.d/asterisk status' etc) is Enabled but
|
||||||
# Not Active at this point.
|
# Not Active at this point.
|
||||||
|
|
|
@ -11,6 +11,12 @@
|
||||||
# and security enhancements using timestamps under /library/wordpress, as these
|
# and security enhancements using timestamps under /library/wordpress, as these
|
||||||
# can arise without warning when WordPress is online, since WordPress ~4.8
|
# can arise without warning when WordPress is online, since WordPress ~4.8
|
||||||
|
|
||||||
|
|
||||||
|
- name: "Run roles/www_options/tasks/set-php-limits.yml with 'nginx_high_php_limits: False' by default"
|
||||||
|
include_tasks: roles/www_options/tasks/set-php-limits.yml
|
||||||
|
when: set_php_limits is undefined
|
||||||
|
|
||||||
|
|
||||||
# 2021-06-29: PHP modules, covering "RECOMMENDED" and "OPTIONAL" sections here:
|
# 2021-06-29: PHP modules, covering "RECOMMENDED" and "OPTIONAL" sections here:
|
||||||
# https://make.wordpress.org/hosting/handbook/server-environment/
|
# https://make.wordpress.org/hosting/handbook/server-environment/
|
||||||
- name: Install libsodium23 + 8 PHP packages (run 'php -m' or 'php -i' to verify)
|
- name: Install libsodium23 + 8 PHP packages (run 'php -m' or 'php -i' to verify)
|
||||||
|
|
|
@ -51,87 +51,7 @@
|
||||||
when: lxde_pi_autostart_present.stat.exists and chromium_present.stat.exists
|
when: lxde_pi_autostart_present.stat.exists and chromium_present.stat.exists
|
||||||
|
|
||||||
|
|
||||||
- debug:
|
# 2022-12-29: set-php-limits.yml run on demand (by roles that need it)
|
||||||
msg: 'THE 5 ANSIBLE STANZAS BELOW ONLY RUN... when: matomo_install or moodle_install or nextcloud_install or pbx_install or wordpress_install'
|
|
||||||
|
|
||||||
- block: # 5-STANZA BLOCK BEGINS
|
|
||||||
|
|
||||||
# roles/nginx has installed pkg 'php{{ php_version }}-fpm' in 3-base-server
|
|
||||||
|
|
||||||
- name: "Enact 'nginx_high_php_limits: False' in /etc/php/{{ php_version }}/fpm/php.ini for LIGHTWEIGHT use of Matomo/Nextcloud/PBX/WordPress (allow photos/docs up to 100MB, 100s timeouts, with 2 PHP system defaults: memory_limit = 128M, max_input_vars = 1000)"
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/php/{{ php_version }}/fpm/php.ini # COMPARE /etc/php/{{ php_version }}/cli/php.ini AND /etc/php/{{ php_version }}/apache2/php.ini
|
|
||||||
regexp: "{{ item.regexp }}"
|
|
||||||
line: "{{ item.line }}"
|
|
||||||
with_items:
|
|
||||||
- { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 100M ; default is 2M' }
|
|
||||||
- { regexp: '^post_max_size', line: 'post_max_size = 100M ; default is 8M' }
|
|
||||||
- { regexp: '^max_execution_time', line: 'max_execution_time = 100 ; default is 30' }
|
|
||||||
- { regexp: '^max_input_time', line: 'max_input_time = 100 ; default is 60' }
|
|
||||||
- { regexp: '^memory_limit', line: 'memory_limit = 128M ; default is 128M / Nextcloud requests 512M' }
|
|
||||||
- { regexp: '^max_input_vars', line: 'max_input_vars = 1000 ; default is 1000 / Moodle 3.11+ requires 5000+ with PHP 8+' }
|
|
||||||
when: not nginx_high_php_limits and not moodle_install # REMINDER: THIS ENTIRE 5-STANZA BLOCK IS ONLY INVOKED... when: matomo_install or moodle_install or nextcloud_install or pbx_install or wordpress_install
|
|
||||||
|
|
||||||
- name: "Enact 'nginx_high_php_limits: False' in /etc/php/{{ php_version }}/cli/php.ini for LIGHTWEIGHT use of Matomo/Nextcloud/PBX/WordPress (allow photos/docs up to 100MB, 100s timeouts, with 2 PHP system defaults: memory_limit = 128M, max_input_vars = 1000)"
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/php/{{ php_version }}/cli/php.ini # COMPARE /etc/php/{{ php_version }}/fpm/php.ini AND /etc/php/{{ php_version }}/apache2/php.ini
|
|
||||||
regexp: "{{ item.regexp }}"
|
|
||||||
line: "{{ item.line }}"
|
|
||||||
with_items:
|
|
||||||
- { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 100M ; default is 2M' }
|
|
||||||
- { regexp: '^post_max_size', line: 'post_max_size = 100M ; default is 8M' }
|
|
||||||
- { regexp: '^max_execution_time', line: 'max_execution_time = 100 ; default is 30' }
|
|
||||||
- { regexp: '^max_input_time', line: 'max_input_time = 100 ; default is 60' }
|
|
||||||
- { regexp: '^memory_limit', line: 'memory_limit = 128M ; default is -1 (i.e. no limit) / Nextcloud requests 512M' }
|
|
||||||
- { regexp: '^max_input_vars', line: 'max_input_vars = 1000 ; default is 1000 / Moodle 3.11+ requires 5000+ with PHP 8+' }
|
|
||||||
when: not nginx_high_php_limits and not moodle_install # REMINDER: THIS ENTIRE 5-STANZA BLOCK IS ONLY INVOKED... when: matomo_install or moodle_install or nextcloud_install or pbx_install or wordpress_install
|
|
||||||
|
|
||||||
# WARNING: This might cause excess use of RAM/disk or other resources!
|
|
||||||
# The first 5 values below were chosen by @ericnitschke and @kananigit on
|
|
||||||
# 2018-09-19: https://github.com/iiab/iiab/issues/1147
|
|
||||||
|
|
||||||
# 2020-03-08: IIAB DOES NOT SUPPORT UNINSTALLING APPS, so additional
|
|
||||||
# clauses (to reset/restore PHP's defaults) are not necessary at this time.
|
|
||||||
|
|
||||||
# 2021-06-28: WITH PHP 8, MOODLE'S CLI INSTALLER UNFORTUNATELY *REQUIRES*
|
|
||||||
# editing /etc/php/{{ php_version }}/cli/php.ini (below) -- though during
|
|
||||||
# regular operation it uses: .../fpm/php.ini
|
|
||||||
# And in the past it used: .../apache2/php.ini
|
|
||||||
|
|
||||||
- name: "Enact 'nginx_high_php_limits: True' in /etc/php/{{ php_version }}/fpm/php.ini for Moodle or INTENSIVE use of Matomo/Nextcloud/PBX/WordPress (allow photos/docs up to 500MB, 300s timeouts, memory_limit = 512M for Nextcloud, max_input_vars = 5000 for Moodle)"
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/php/{{ php_version }}/fpm/php.ini # COMPARE /etc/php/{{ php_version }}/cli/php.ini AND /etc/php/{{ php_version }}/apache2/php.ini
|
|
||||||
regexp: "{{ item.regexp }}"
|
|
||||||
line: "{{ item.line }}"
|
|
||||||
with_items:
|
|
||||||
- { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 500M ; default is 2M' }
|
|
||||||
- { regexp: '^post_max_size', line: 'post_max_size = 500M ; default is 8M' }
|
|
||||||
- { regexp: '^max_execution_time', line: 'max_execution_time = 300 ; default is 30' }
|
|
||||||
- { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' }
|
|
||||||
- { regexp: '^memory_limit', line: 'memory_limit = 512M ; default is 128M / Nextcloud requests 512M' }
|
|
||||||
- { regexp: '^max_input_vars', line: 'max_input_vars = 5000 ; default is 1000 / Moodle 3.11+ requires 5000+ with PHP 8+' }
|
|
||||||
when: nginx_high_php_limits or moodle_install # REMINDER: THIS ENTIRE 5-STANZA BLOCK IS ONLY INVOKED... when: matomo_install or moodle_install or nextcloud_install or pbx_install or wordpress_install
|
|
||||||
|
|
||||||
- name: "Enact 'nginx_high_php_limits: True' in /etc/php/{{ php_version }}/cli/php.ini for Moodle or INTENSIVE use of Matomo/Nextcloud/PBX/WordPress (allow photos/docs up to 500MB, 300s timeouts, memory_limit = 512M for Nextcloud, max_input_vars = 5000 for Moodle)"
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/php/{{ php_version }}/cli/php.ini # COMPARE /etc/php/{{ php_version }}/fpm/php.ini AND /etc/php/{{ php_version }}/apache2/php.ini
|
|
||||||
regexp: "{{ item.regexp }}"
|
|
||||||
line: "{{ item.line }}"
|
|
||||||
with_items:
|
|
||||||
- { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 500M ; default is 2M' }
|
|
||||||
- { regexp: '^post_max_size', line: 'post_max_size = 500M ; default is 8M' }
|
|
||||||
- { regexp: '^max_execution_time', line: 'max_execution_time = 300 ; default is 30' }
|
|
||||||
- { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' }
|
|
||||||
- { regexp: '^memory_limit', line: 'memory_limit = 512M ; default is -1 (i.e. no limit) / Nextcloud requests 512M' }
|
|
||||||
- { regexp: '^max_input_vars', line: 'max_input_vars = 5000 ; default is 1000 / Moodle 3.11+ requires 5000+ with PHP 8+' }
|
|
||||||
when: nginx_high_php_limits or moodle_install # REMINDER: THIS ENTIRE 5-STANZA BLOCK IS ONLY INVOKED... when: matomo_install or moodle_install or nextcloud_install or pbx_install or wordpress_install
|
|
||||||
|
|
||||||
- name: Restart 'php{{ php_version }}-fpm' systemd service
|
|
||||||
systemd:
|
|
||||||
name: php{{ php_version }}-fpm
|
|
||||||
state: restarted
|
|
||||||
|
|
||||||
when: matomo_install or moodle_install or nextcloud_install or pbx_install or wordpress_install # 5-STANZA BLOCK ENDS. COMPARE apache_allow_sudo conditionals below.
|
|
||||||
|
|
||||||
|
|
||||||
# 'Is a "Rapid Power Off" button possible for low-electricity environments?'
|
# 'Is a "Rapid Power Off" button possible for low-electricity environments?'
|
||||||
|
|
177
roles/www_options/tasks/set-php-limits.yml
Normal file
177
roles/www_options/tasks/set-php-limits.yml
Normal file
|
@ -0,0 +1,177 @@
|
||||||
|
# As of 2022-12-29, this is invoked by:
|
||||||
|
#
|
||||||
|
# roles/matomo/tasks/install.yml
|
||||||
|
# roles/moodle/tasks/install.yml
|
||||||
|
# roles/nextcloud/tasks/install.yml
|
||||||
|
# roles/pbx/tasks/freepbx.yml
|
||||||
|
# roles/wordpress/tasks/install.yml
|
||||||
|
|
||||||
|
# Ansible's ini_file would normally be best, to tweak .ini files:
|
||||||
|
# https://docs.ansible.com/ansible/latest/collections/community/general/ini_file_module.html
|
||||||
|
#
|
||||||
|
# But in this case, explanatory comments (inserted by lineinfile below) offer
|
||||||
|
# important context to implementers modifying both php.ini files after the fact.
|
||||||
|
|
||||||
|
|
||||||
|
# WARNING: 'nginx_high_php_limits: True' (especially!) might cause excess use of
|
||||||
|
# RAM/disk or other resources! Five original values below chosen by @kananigit
|
||||||
|
# and @ericnitschke on 2018-09-19: https://github.com/iiab/iiab/issues/1147
|
||||||
|
|
||||||
|
# 2020-03-08: IIAB DOES NOT SUPPORT UNINSTALLING APPS, so additional clauses
|
||||||
|
# (to reset/restore PHP's own defaults) are not necessary at this time.
|
||||||
|
|
||||||
|
# 2021-06-28: WITH PHP 8.x, MOODLE'S CLI INSTALLER UNFORTUNATELY *REQUIRES*
|
||||||
|
# editing /etc/php/{{ php_version }}/cli/php.ini (below) -- though during
|
||||||
|
# regular operation it uses: .../fpm/php.ini
|
||||||
|
# And in the past it used: .../apache2/php.ini
|
||||||
|
|
||||||
|
|
||||||
|
- name: "Enact 'nginx_high_php_limits: False' in /etc/php/{{ php_version }}/fpm/php.ini for LIGHTWEIGHT use of Matomo/Nextcloud/PBX/WordPress (allow photos/docs up to 100MB, 100s timeouts, with 2 PHP system defaults: memory_limit = 128M, max_input_vars = 1000)"
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/php/{{ php_version }}/fpm/php.ini # COMPARE /etc/php/{{ php_version }}/cli/php.ini AND /etc/php/{{ php_version }}/apache2/php.ini
|
||||||
|
regexp: "{{ item.regexp }}"
|
||||||
|
line: "{{ item.line }}"
|
||||||
|
with_items:
|
||||||
|
- { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 100M ; default is 2M' }
|
||||||
|
- { regexp: '^post_max_size', line: 'post_max_size = 100M ; default is 8M' }
|
||||||
|
- { regexp: '^max_execution_time', line: 'max_execution_time = 100 ; default is 30' }
|
||||||
|
- { regexp: '^max_input_time', line: 'max_input_time = 100 ; default is 60' }
|
||||||
|
- { regexp: '^memory_limit', line: 'memory_limit = 128M ; default is 128M / Nextcloud requests 512M' }
|
||||||
|
- { regexp: '^max_input_vars', line: 'max_input_vars = 1000 ; default is 1000 / Moodle 3.11+ requires 5000+ with PHP 8+' }
|
||||||
|
when: not nginx_high_php_limits and not moodle_install
|
||||||
|
|
||||||
|
- name: "Enact 'nginx_high_php_limits: False' in /etc/php/{{ php_version }}/cli/php.ini for LIGHTWEIGHT use of Matomo/Nextcloud/PBX/WordPress (allow photos/docs up to 100MB, 100s timeouts, with 2 PHP system defaults: memory_limit = 128M, max_input_vars = 1000)"
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/php/{{ php_version }}/cli/php.ini # COMPARE /etc/php/{{ php_version }}/fpm/php.ini AND /etc/php/{{ php_version }}/apache2/php.ini
|
||||||
|
regexp: "{{ item.regexp }}"
|
||||||
|
line: "{{ item.line }}"
|
||||||
|
with_items:
|
||||||
|
- { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 100M ; default is 2M' }
|
||||||
|
- { regexp: '^post_max_size', line: 'post_max_size = 100M ; default is 8M' }
|
||||||
|
- { regexp: '^max_execution_time', line: 'max_execution_time = 100 ; default is 30' }
|
||||||
|
- { regexp: '^max_input_time', line: 'max_input_time = 100 ; default is 60' }
|
||||||
|
- { regexp: '^memory_limit', line: 'memory_limit = 128M ; default is -1 (i.e. no limit) / Nextcloud requests 512M' }
|
||||||
|
- { regexp: '^max_input_vars', line: 'max_input_vars = 1000 ; default is 1000 / Moodle 3.11+ requires 5000+ with PHP 8+' }
|
||||||
|
when: not nginx_high_php_limits and not moodle_install
|
||||||
|
|
||||||
|
|
||||||
|
- name: "Enact 'nginx_high_php_limits: True' in /etc/php/{{ php_version }}/fpm/php.ini for Moodle or INTENSIVE use of Matomo/Nextcloud/PBX/WordPress (allow photos/docs up to 500MB, 300s timeouts, memory_limit = 512M for Nextcloud, max_input_vars = 5000 for Moodle)"
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/php/{{ php_version }}/fpm/php.ini # COMPARE /etc/php/{{ php_version }}/cli/php.ini AND /etc/php/{{ php_version }}/apache2/php.ini
|
||||||
|
regexp: "{{ item.regexp }}"
|
||||||
|
line: "{{ item.line }}"
|
||||||
|
with_items:
|
||||||
|
- { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 500M ; default is 2M' }
|
||||||
|
- { regexp: '^post_max_size', line: 'post_max_size = 500M ; default is 8M' }
|
||||||
|
- { regexp: '^max_execution_time', line: 'max_execution_time = 300 ; default is 30' }
|
||||||
|
- { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' }
|
||||||
|
- { regexp: '^memory_limit', line: 'memory_limit = 512M ; default is 128M / Nextcloud requests 512M' }
|
||||||
|
- { regexp: '^max_input_vars', line: 'max_input_vars = 5000 ; default is 1000 / Moodle 3.11+ requires 5000+ with PHP 8+' }
|
||||||
|
when: nginx_high_php_limits or moodle_install
|
||||||
|
|
||||||
|
- name: "Enact 'nginx_high_php_limits: True' in /etc/php/{{ php_version }}/cli/php.ini for Moodle or INTENSIVE use of Matomo/Nextcloud/PBX/WordPress (allow photos/docs up to 500MB, 300s timeouts, memory_limit = 512M for Nextcloud, max_input_vars = 5000 for Moodle)"
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/php/{{ php_version }}/cli/php.ini # COMPARE /etc/php/{{ php_version }}/fpm/php.ini AND /etc/php/{{ php_version }}/apache2/php.ini
|
||||||
|
regexp: "{{ item.regexp }}"
|
||||||
|
line: "{{ item.line }}"
|
||||||
|
with_items:
|
||||||
|
- { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 500M ; default is 2M' }
|
||||||
|
- { regexp: '^post_max_size', line: 'post_max_size = 500M ; default is 8M' }
|
||||||
|
- { regexp: '^max_execution_time', line: 'max_execution_time = 300 ; default is 30' }
|
||||||
|
- { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' }
|
||||||
|
- { regexp: '^memory_limit', line: 'memory_limit = 512M ; default is -1 (i.e. no limit) / Nextcloud requests 512M' }
|
||||||
|
- { regexp: '^max_input_vars', line: 'max_input_vars = 5000 ; default is 1000 / Moodle 3.11+ requires 5000+ with PHP 8+' }
|
||||||
|
when: nginx_high_php_limits or moodle_install
|
||||||
|
|
||||||
|
|
||||||
|
- name: Restart 'php{{ php_version }}-fpm' systemd service
|
||||||
|
systemd:
|
||||||
|
name: php{{ php_version }}-fpm
|
||||||
|
state: restarted
|
||||||
|
|
||||||
|
- name: "Set 'set_php_limits: True' so set-php-limits.yml runs just once (per Ansible run)"
|
||||||
|
set_fact:
|
||||||
|
set_php_limits: True
|
||||||
|
|
||||||
|
|
||||||
|
# - debug:
|
||||||
|
# msg: 'THE 5 ANSIBLE STANZAS BELOW ONLY RUN... when: matomo_install or moodle_install or nextcloud_install or pbx_install or wordpress_install'
|
||||||
|
|
||||||
|
# - block: # 5-STANZA BLOCK BEGINS
|
||||||
|
|
||||||
|
# # roles/nginx has installed pkg 'php{{ php_version }}-fpm' in 3-base-server
|
||||||
|
|
||||||
|
# - name: "Enact 'nginx_high_php_limits: False' in /etc/php/{{ php_version }}/fpm/php.ini for LIGHTWEIGHT use of Matomo/Nextcloud/PBX/WordPress (allow photos/docs up to 100MB, 100s timeouts, with 2 PHP system defaults: memory_limit = 128M, max_input_vars = 1000)"
|
||||||
|
# lineinfile:
|
||||||
|
# path: /etc/php/{{ php_version }}/fpm/php.ini # COMPARE /etc/php/{{ php_version }}/cli/php.ini AND /etc/php/{{ php_version }}/apache2/php.ini
|
||||||
|
# regexp: "{{ item.regexp }}"
|
||||||
|
# line: "{{ item.line }}"
|
||||||
|
# with_items:
|
||||||
|
# - { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 100M ; default is 2M' }
|
||||||
|
# - { regexp: '^post_max_size', line: 'post_max_size = 100M ; default is 8M' }
|
||||||
|
# - { regexp: '^max_execution_time', line: 'max_execution_time = 100 ; default is 30' }
|
||||||
|
# - { regexp: '^max_input_time', line: 'max_input_time = 100 ; default is 60' }
|
||||||
|
# - { regexp: '^memory_limit', line: 'memory_limit = 128M ; default is 128M / Nextcloud requests 512M' }
|
||||||
|
# - { regexp: '^max_input_vars', line: 'max_input_vars = 1000 ; default is 1000 / Moodle 3.11+ requires 5000+ with PHP 8+' }
|
||||||
|
# when: not nginx_high_php_limits and not moodle_install # REMINDER: THIS ENTIRE 5-STANZA BLOCK IS ONLY INVOKED... when: matomo_install or moodle_install or nextcloud_install or pbx_install or wordpress_install
|
||||||
|
|
||||||
|
# - name: "Enact 'nginx_high_php_limits: False' in /etc/php/{{ php_version }}/cli/php.ini for LIGHTWEIGHT use of Matomo/Nextcloud/PBX/WordPress (allow photos/docs up to 100MB, 100s timeouts, with 2 PHP system defaults: memory_limit = 128M, max_input_vars = 1000)"
|
||||||
|
# lineinfile:
|
||||||
|
# path: /etc/php/{{ php_version }}/cli/php.ini # COMPARE /etc/php/{{ php_version }}/fpm/php.ini AND /etc/php/{{ php_version }}/apache2/php.ini
|
||||||
|
# regexp: "{{ item.regexp }}"
|
||||||
|
# line: "{{ item.line }}"
|
||||||
|
# with_items:
|
||||||
|
# - { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 100M ; default is 2M' }
|
||||||
|
# - { regexp: '^post_max_size', line: 'post_max_size = 100M ; default is 8M' }
|
||||||
|
# - { regexp: '^max_execution_time', line: 'max_execution_time = 100 ; default is 30' }
|
||||||
|
# - { regexp: '^max_input_time', line: 'max_input_time = 100 ; default is 60' }
|
||||||
|
# - { regexp: '^memory_limit', line: 'memory_limit = 128M ; default is -1 (i.e. no limit) / Nextcloud requests 512M' }
|
||||||
|
# - { regexp: '^max_input_vars', line: 'max_input_vars = 1000 ; default is 1000 / Moodle 3.11+ requires 5000+ with PHP 8+' }
|
||||||
|
# when: not nginx_high_php_limits and not moodle_install # REMINDER: THIS ENTIRE 5-STANZA BLOCK IS ONLY INVOKED... when: matomo_install or moodle_install or nextcloud_install or pbx_install or wordpress_install
|
||||||
|
|
||||||
|
# # WARNING: This might cause excess use of RAM/disk or other resources!
|
||||||
|
# # The first 5 values below were chosen by @ericnitschke and @kananigit on
|
||||||
|
# # 2018-09-19: https://github.com/iiab/iiab/issues/1147
|
||||||
|
|
||||||
|
# # 2020-03-08: IIAB DOES NOT SUPPORT UNINSTALLING APPS, so additional
|
||||||
|
# # clauses (to reset/restore PHP's defaults) are not necessary at this time.
|
||||||
|
|
||||||
|
# # 2021-06-28: WITH PHP 8, MOODLE'S CLI INSTALLER UNFORTUNATELY *REQUIRES*
|
||||||
|
# # editing /etc/php/{{ php_version }}/cli/php.ini (below) -- though during
|
||||||
|
# # regular operation it uses: .../fpm/php.ini
|
||||||
|
# # And in the past it used: .../apache2/php.ini
|
||||||
|
|
||||||
|
# - name: "Enact 'nginx_high_php_limits: True' in /etc/php/{{ php_version }}/fpm/php.ini for Moodle or INTENSIVE use of Matomo/Nextcloud/PBX/WordPress (allow photos/docs up to 500MB, 300s timeouts, memory_limit = 512M for Nextcloud, max_input_vars = 5000 for Moodle)"
|
||||||
|
# lineinfile:
|
||||||
|
# path: /etc/php/{{ php_version }}/fpm/php.ini # COMPARE /etc/php/{{ php_version }}/cli/php.ini AND /etc/php/{{ php_version }}/apache2/php.ini
|
||||||
|
# regexp: "{{ item.regexp }}"
|
||||||
|
# line: "{{ item.line }}"
|
||||||
|
# with_items:
|
||||||
|
# - { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 500M ; default is 2M' }
|
||||||
|
# - { regexp: '^post_max_size', line: 'post_max_size = 500M ; default is 8M' }
|
||||||
|
# - { regexp: '^max_execution_time', line: 'max_execution_time = 300 ; default is 30' }
|
||||||
|
# - { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' }
|
||||||
|
# - { regexp: '^memory_limit', line: 'memory_limit = 512M ; default is 128M / Nextcloud requests 512M' }
|
||||||
|
# - { regexp: '^max_input_vars', line: 'max_input_vars = 5000 ; default is 1000 / Moodle 3.11+ requires 5000+ with PHP 8+' }
|
||||||
|
# when: nginx_high_php_limits or moodle_install # REMINDER: THIS ENTIRE 5-STANZA BLOCK IS ONLY INVOKED... when: matomo_install or moodle_install or nextcloud_install or pbx_install or wordpress_install
|
||||||
|
|
||||||
|
# - name: "Enact 'nginx_high_php_limits: True' in /etc/php/{{ php_version }}/cli/php.ini for Moodle or INTENSIVE use of Matomo/Nextcloud/PBX/WordPress (allow photos/docs up to 500MB, 300s timeouts, memory_limit = 512M for Nextcloud, max_input_vars = 5000 for Moodle)"
|
||||||
|
# lineinfile:
|
||||||
|
# path: /etc/php/{{ php_version }}/cli/php.ini # COMPARE /etc/php/{{ php_version }}/fpm/php.ini AND /etc/php/{{ php_version }}/apache2/php.ini
|
||||||
|
# regexp: "{{ item.regexp }}"
|
||||||
|
# line: "{{ item.line }}"
|
||||||
|
# with_items:
|
||||||
|
# - { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 500M ; default is 2M' }
|
||||||
|
# - { regexp: '^post_max_size', line: 'post_max_size = 500M ; default is 8M' }
|
||||||
|
# - { regexp: '^max_execution_time', line: 'max_execution_time = 300 ; default is 30' }
|
||||||
|
# - { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' }
|
||||||
|
# - { regexp: '^memory_limit', line: 'memory_limit = 512M ; default is -1 (i.e. no limit) / Nextcloud requests 512M' }
|
||||||
|
# - { regexp: '^max_input_vars', line: 'max_input_vars = 5000 ; default is 1000 / Moodle 3.11+ requires 5000+ with PHP 8+' }
|
||||||
|
# when: nginx_high_php_limits or moodle_install # REMINDER: THIS ENTIRE 5-STANZA BLOCK IS ONLY INVOKED... when: matomo_install or moodle_install or nextcloud_install or pbx_install or wordpress_install
|
||||||
|
|
||||||
|
# - name: Restart 'php{{ php_version }}-fpm' systemd service
|
||||||
|
# systemd:
|
||||||
|
# name: php{{ php_version }}-fpm
|
||||||
|
# state: restarted
|
||||||
|
|
||||||
|
# when: matomo_install or moodle_install or nextcloud_install or pbx_install or wordpress_install # 5-STANZA BLOCK ENDS. COMPARE apache_allow_sudo conditionals below.
|
|
@ -504,7 +504,8 @@ postgresql_enabled: False
|
||||||
# Warning: Moodle is a serious LMS, that takes a while to install.
|
# Warning: Moodle is a serious LMS, that takes a while to install.
|
||||||
moodle_install: False
|
moodle_install: False
|
||||||
moodle_enabled: False
|
moodle_enabled: False
|
||||||
# If using Moodle intensively, set nginx_high_php_limits further above.
|
# FYI 'nginx_high_php_limits: True' (explained above) is mandated with Moodle,
|
||||||
|
# as auto-enacted by roles/www_options/tasks/set-php-limits.yml
|
||||||
|
|
||||||
# Regional OSM vector maps use far less disk space than bitmap/raster versions.
|
# Regional OSM vector maps use far less disk space than bitmap/raster versions.
|
||||||
# Instructions: https://github.com/iiab/iiab/wiki/IIAB-Maps
|
# Instructions: https://github.com/iiab/iiab/wiki/IIAB-Maps
|
||||||
|
|
|
@ -296,7 +296,8 @@ kiwix_enabled: True
|
||||||
# Warning: Moodle is a serious LMS, that takes a while to install
|
# Warning: Moodle is a serious LMS, that takes a while to install
|
||||||
moodle_install: True
|
moodle_install: True
|
||||||
moodle_enabled: True
|
moodle_enabled: True
|
||||||
# If using Moodle intensively, set nginx_high_php_limits further above.
|
# FYI 'nginx_high_php_limits: True' (explained above) is mandated with Moodle,
|
||||||
|
# as auto-enacted by roles/www_options/tasks/set-php-limits.yml
|
||||||
|
|
||||||
# Regional OSM vector maps use far less disk space than bitmap/raster versions.
|
# Regional OSM vector maps use far less disk space than bitmap/raster versions.
|
||||||
# Instructions: https://github.com/iiab/iiab/wiki/IIAB-Maps
|
# Instructions: https://github.com/iiab/iiab/wiki/IIAB-Maps
|
||||||
|
|
|
@ -296,7 +296,8 @@ kiwix_enabled: True
|
||||||
# Warning: Moodle is a serious LMS, that takes a while to install
|
# Warning: Moodle is a serious LMS, that takes a while to install
|
||||||
moodle_install: False
|
moodle_install: False
|
||||||
moodle_enabled: False
|
moodle_enabled: False
|
||||||
# If using Moodle intensively, set nginx_high_php_limits further above.
|
# FYI 'nginx_high_php_limits: True' (explained above) is mandated with Moodle,
|
||||||
|
# as auto-enacted by roles/www_options/tasks/set-php-limits.yml
|
||||||
|
|
||||||
# Regional OSM vector maps use far less disk space than bitmap/raster versions.
|
# Regional OSM vector maps use far less disk space than bitmap/raster versions.
|
||||||
# Instructions: https://github.com/iiab/iiab/wiki/IIAB-Maps
|
# Instructions: https://github.com/iiab/iiab/wiki/IIAB-Maps
|
||||||
|
|
|
@ -296,7 +296,8 @@ kiwix_enabled: True
|
||||||
# Warning: Moodle is a serious LMS, that takes a while to install.
|
# Warning: Moodle is a serious LMS, that takes a while to install.
|
||||||
moodle_install: False
|
moodle_install: False
|
||||||
moodle_enabled: False
|
moodle_enabled: False
|
||||||
# If using Moodle intensively, set nginx_high_php_limits further above.
|
# FYI 'nginx_high_php_limits: True' (explained above) is mandated with Moodle,
|
||||||
|
# as auto-enacted by roles/www_options/tasks/set-php-limits.yml
|
||||||
|
|
||||||
# Regional OSM vector maps use far less disk space than bitmap/raster versions.
|
# Regional OSM vector maps use far less disk space than bitmap/raster versions.
|
||||||
# Instructions: https://github.com/iiab/iiab/wiki/IIAB-Maps
|
# Instructions: https://github.com/iiab/iiab/wiki/IIAB-Maps
|
||||||
|
|
|
@ -296,7 +296,8 @@ kiwix_enabled: False
|
||||||
# Warning: Moodle is a serious LMS, that takes a while to install.
|
# Warning: Moodle is a serious LMS, that takes a while to install.
|
||||||
moodle_install: False
|
moodle_install: False
|
||||||
moodle_enabled: False
|
moodle_enabled: False
|
||||||
# If using Moodle intensively, set nginx_high_php_limits further above.
|
# FYI 'nginx_high_php_limits: True' (explained above) is mandated with Moodle,
|
||||||
|
# as auto-enacted by roles/www_options/tasks/set-php-limits.yml
|
||||||
|
|
||||||
# Regional OSM vector maps use far less disk space than bitmap/raster versions.
|
# Regional OSM vector maps use far less disk space than bitmap/raster versions.
|
||||||
# Instructions: https://github.com/iiab/iiab/wiki/IIAB-Maps
|
# Instructions: https://github.com/iiab/iiab/wiki/IIAB-Maps
|
||||||
|
|
Loading…
Reference in a new issue