Commit 2423769d authored by Arie Peterson's avatar Arie Peterson 🐚
Browse files

Create mu-plugins load.php using ansible template

parent f124d359
......@@ -16,20 +16,6 @@
mode: "0750"
state: directory
- name: Add MU plugins load.php file
file:
path: "{{ WP_CONTENT_DIR }}/mu-plugins/load.php"
state: touch
# owner: "{{ wp_user }}"
# group: "{{ wp_group }}"
mode: "0640"
- name: Insert the base code into MU plugins load.php file
lineinfile:
dest: "{{ WP_CONTENT_DIR }}/mu-plugins/load.php"
line: "<?php // mu-plugins/load.php"
### Install plugins then move them to the MU plugins folder
- name: Install plugins before they are MU
......@@ -40,18 +26,14 @@
shell: mv "{{ WP_CONTENT_DIR }}/plugins/{{ item.key }}" "{{ WP_CONTENT_DIR }}/mu-plugins/{{ item.key }}"
with_dict: "{{ mu_plugins_list }}"
- name: Echo all the MU plugins filenames into the load.php file
lineinfile:
- name: Template load.php to load all the MU plugins
template:
src: "load.php.j2"
dest: "{{ WP_CONTENT_DIR }}/mu-plugins/load.php"
line: "require(WPMU_PLUGIN_DIR . '/{{ item.key }}/{{ item.value.phpfile }}');"
insertbefore: EOF
with_dict: "{{ mu_plugins_list }}"
mode: "0640"
### Missing
# + Add cron settings (see wp-cron-control.yaml in directory)
# + Activate Redis !!! I think that the object-cache.php file could be activated twice and I need to check this
# - name: Activate redis via the plugin
# shell: wp {{ cli_args }} redis enable
###
### Permissions and tidy-up
......
<?php
{% for item in mu_plugins_list %}
require(WPMU_PLUGIN_DIR . '/{{ item }}/{{ mu_plugins_list[item].phpfile }}');
{% endfor %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment