1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Merge pull request #1161 from holta/wordpress-pro

wordpress_raise_php_limits variable for schools that use Wordpress intensively
This commit is contained in:
A Holt 2018-09-22 11:30:31 -04:00 committed by GitHub
commit 4df699a807
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 11 deletions

View file

@ -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

View file

@ -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 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
@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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