From 5b155000123a536d9c1e3b8ebafaab130913d91c Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 22 Sep 2018 10:40:01 -0400 Subject: [PATCH 1/9] Update main.yml --- roles/wordpress/defaults/main.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/roles/wordpress/defaults/main.yml b/roles/wordpress/defaults/main.yml index 1a84d3164..8a088c1ed 100644 --- a/roles/wordpress/defaults/main.yml +++ b/roles/wordpress/defaults/main.yml @@ -1,3 +1,10 @@ +wordpress_install: True +wordpress_enabled: True + +# For schools that use WordPress intensively. WARNING: Enabling this (might) +# cause excess use of RAM or other resources? github.com/iiab/iiab/issues/1147 +wordpress_raise_php_limits: False + wordpress_download_base_url: https://wordpress.org wordpress_src: latest.tar.gz @@ -5,9 +12,6 @@ wp_db_name: iiab_wp wp_db_user: iiab_wp wp_db_user_password: changeme -wordpress_install: True -wordpress_enabled: True - wp_install_path: "{{ content_base }}" #wp_install_path: /library From 5664b555e809de1f78e4c23c419e3f4030477104 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 22 Sep 2018 10:42:06 -0400 Subject: [PATCH 2/9] Update main.yml --- roles/wordpress/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/wordpress/tasks/main.yml b/roles/wordpress/tasks/main.yml index 664bd28d0..742089d18 100644 --- a/roles/wordpress/tasks/main.yml +++ b/roles/wordpress/tasks/main.yml @@ -1,5 +1,5 @@ # SEE "emergency" REINSTALL INSTRUCTIONS IN roles/wordpress/tasks/install.yml -- name: Include the install playbook +- name: Install WordPress if wordpress_install include_tasks: install.yml when: wordpress_install From b61a46944ca21029a903ba38a2127056e0ab3520 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 22 Sep 2018 11:03:44 -0400 Subject: [PATCH 3/9] Update install.yml --- roles/wordpress/tasks/install.yml | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/roles/wordpress/tasks/install.yml b/roles/wordpress/tasks/install.yml index fa794dd3c..3b88d9972 100644 --- a/roles/wordpress/tasks/install.yml +++ b/roles/wordpress/tasks/install.yml @@ -7,9 +7,9 @@ # - "mv /library/wordpress /library/wordpress.old" # - back up WordPress's database then drop it # -# REASON: "keep_newer: yes" below tries to preserves WordPress's self-upgrades +# REASON: "keep_newer: yes" below tries to preserve WordPress's self-upgrades # 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: Download the latest WordPress software get_url: @@ -47,6 +47,21 @@ mode: 0664 keep_newer: yes +# For schools that use WordPress intensively. WARNING: Enabling this (might) +# cause excess use of RAM or other resources? github.com/iiab/iiab/issues/1147 +- name: Raise php.ini limits in schools that use WordPress intensively + lineinfile: + path: "/etc/php/{{ php_version }}/{{ apache_service }}/php.ini" + regexp: "{{ item.regexp }}" + line: "{{ item.line }}" + when: wordpress_raise_php_limits + with_items: + - { regexp: '^upload_max_filesize', line: 'upload_max_filesize 64M ; default on RPi is 2M' } + - { regexp: '^post_max_size', line: 'post_max_size 128M ; default on RPi is 8M' } + - { regexp: '^memory_limit', line: 'memory_limit 256M ; default on RPi is 128M' } + - { regexp: '^max_execution_time', line: 'max_execution_time 300 ; default on RPi is 30' } + - { regexp: '^max_input_time', line: 'max_input_time 300 ; default on RPi is 60' } + # - name: Rename /library/wordpress* to /library/wordpress # shell: if [ ! -d {{ wp_abs_path }} ]; then mv {{ wp_abs_path }}* {{ wp_abs_path }}; fi @@ -104,7 +119,7 @@ priv: "{{ wp_db_name }}.*:ALL,GRANT" state: present -- name: Copy WordPress config file +- name: Copy wp-config.php template: src: wp-config.php.j2 dest: "{{ wp_abs_path }}/wp-config.php" @@ -112,25 +127,25 @@ group: "{{ apache_user }}" mode: 0660 -- name: Copy WordPress httpd conf file +- name: Copy wordpress.conf to permit http://box{{ wp_url }} template: src: wordpress.conf.j2 dest: "/etc/{{ apache_config_dir }}/wordpress.conf" -- name: Enable httpd conf file if we are disabled (debuntu) +- name: Enable wordpress.conf if wordpress_enabled (debuntu) file: src: /etc/apache2/sites-available/wordpress.conf dest: /etc/apache2/sites-enabled/wordpress.conf state: link when: wordpress_enabled and is_debuntu -- name: Remove httpd conf file if we are disabled (OS's other than debuntu) +- name: Remove wordpress.conf if not wordpress_enabled (debuntu) file: path: /etc/apache2/sites-enabled/wordpress.conf state: absent when: not wordpress_enabled and is_debuntu -- name: Restart Apache, so it picks up the new aliases +- name: Restart Apache to enable/disable http://box{{ wp_url }} service: name: "{{ apache_service }}" state: restarted From e3cddadbfb47e56021948f5d7a9ca90ace9225bd Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 22 Sep 2018 11:06:28 -0400 Subject: [PATCH 4/9] Update default_vars.yml --- vars/default_vars.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index b0317638c..6cc6426ee 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -280,6 +280,9 @@ nextcloud_enabled: False # WordPress wordpress_install: True wordpress_enabled: False +# For schools that use WordPress intensively. WARNING: Enabling this (might) +# cause excess use of RAM or other resources? github.com/iiab/iiab/issues/1147 +wordpress_raise_php_limits: False # 7-EDU-APPS From e3db8b57f851b96b9d68ab50def3a0a67dc311b1 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 22 Sep 2018 11:06:32 -0400 Subject: [PATCH 5/9] Update local_vars_min.yml --- vars/local_vars_min.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index 8c933ee93..0a7988953 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -154,6 +154,9 @@ nextcloud_enabled: False wordpress_install: False wordpress_enabled: False +# For schools that use WordPress intensively. WARNING: Enabling this (might) +# cause excess use of RAM or other resources? github.com/iiab/iiab/issues/1147 +wordpress_raise_php_limits: False # 7-EDU-APPS From 8e74dc9e2b887772230c669adab3fd4c6e9fb7e5 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 22 Sep 2018 11:06:36 -0400 Subject: [PATCH 6/9] Update local_vars_medium.yml --- vars/local_vars_medium.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index 24c1571b4..81ac82f95 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -154,6 +154,9 @@ nextcloud_enabled: True wordpress_install: True wordpress_enabled: True +# For schools that use WordPress intensively. WARNING: Enabling this (might) +# cause excess use of RAM or other resources? github.com/iiab/iiab/issues/1147 +wordpress_raise_php_limits: False # 7-EDU-APPS From e226e1ed5bd0daf9bb60fd60983bd6110cf47408 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 22 Sep 2018 11:06:40 -0400 Subject: [PATCH 7/9] Update local_vars_big.yml --- vars/local_vars_big.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index e6ab61b54..48416239f 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -154,6 +154,9 @@ nextcloud_enabled: True wordpress_install: True wordpress_enabled: True +# For schools that use WordPress intensively. WARNING: Enabling this (might) +# cause excess use of RAM or other resources? github.com/iiab/iiab/issues/1147 +wordpress_raise_php_limits: False # 7-EDU-APPS From 80dbbe9f61aefd32dd5bdb7c45777aeb329581f7 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 22 Sep 2018 11:16:49 -0400 Subject: [PATCH 8/9] php.ini defaults confirmed on multiple OS's --- roles/wordpress/tasks/install.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/wordpress/tasks/install.yml b/roles/wordpress/tasks/install.yml index 3b88d9972..46651709b 100644 --- a/roles/wordpress/tasks/install.yml +++ b/roles/wordpress/tasks/install.yml @@ -56,11 +56,11 @@ line: "{{ item.line }}" when: wordpress_raise_php_limits with_items: - - { regexp: '^upload_max_filesize', line: 'upload_max_filesize 64M ; default on RPi is 2M' } - - { regexp: '^post_max_size', line: 'post_max_size 128M ; default on RPi is 8M' } - - { regexp: '^memory_limit', line: 'memory_limit 256M ; default on RPi is 128M' } - - { regexp: '^max_execution_time', line: 'max_execution_time 300 ; default on RPi is 30' } - - { regexp: '^max_input_time', line: 'max_input_time 300 ; default on RPi is 60' } + - { regexp: '^upload_max_filesize', line: 'upload_max_filesize 64M ; default is 2M' } + - { regexp: '^post_max_size', line: 'post_max_size 128M ; default is 8M' } + - { regexp: '^memory_limit', line: 'memory_limit 256M ; default is 128M' } + - { regexp: '^max_execution_time', line: 'max_execution_time 300 ; default is 30' } + - { regexp: '^max_input_time', line: 'max_input_time 300 ; default is 60' } # - name: Rename /library/wordpress* to /library/wordpress # shell: if [ ! -d {{ wp_abs_path }} ]; then mv {{ wp_abs_path }}* {{ wp_abs_path }}; fi From 13e7784d6cb49efe79279f1e98d3982a1be7e00d Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 22 Sep 2018 11:21:16 -0400 Subject: [PATCH 9/9] Update install.yml --- roles/wordpress/tasks/install.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/wordpress/tasks/install.yml b/roles/wordpress/tasks/install.yml index 46651709b..57d36b244 100644 --- a/roles/wordpress/tasks/install.yml +++ b/roles/wordpress/tasks/install.yml @@ -56,11 +56,11 @@ line: "{{ item.line }}" when: wordpress_raise_php_limits with_items: - - { regexp: '^upload_max_filesize', line: 'upload_max_filesize 64M ; default is 2M' } - - { regexp: '^post_max_size', line: 'post_max_size 128M ; default is 8M' } - - { regexp: '^memory_limit', line: 'memory_limit 256M ; default is 128M' } - - { 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: '^upload_max_filesize', line: 'upload_max_filesize = 64M ; default is 2M' } + - { regexp: '^post_max_size', line: 'post_max_size = 128M ; default is 8M' } + - { regexp: '^memory_limit', line: 'memory_limit = 256M ; default is 128M' } + - { regexp: '^max_execution_time', line: 'max_execution_time = 300 ; default is 30' } + - { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' } # - name: Rename /library/wordpress* to /library/wordpress # shell: if [ ! -d {{ wp_abs_path }} ]; then mv {{ wp_abs_path }}* {{ wp_abs_path }}; fi