mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 23:38:13 +02:00
Fix: Resolved Discourse plugin bug and unified variable/path handling
- Discourse: fixed 'DISCOURSE_CONTAINERS_DIR' and 'DISCOURSE_APPLICATION_YML_DEST' - Nextcloud: improved plugin enable/configure tasks formatting - WordPress: unified OIDC, msmtp, and upload.ini variables and tasks - General: aligned spacing and switched to path_join for consistency
This commit is contained in:
@@ -17,10 +17,10 @@ DISCOURSE_REPOSITORY_URL: "{{ applications | get_app_conf(application_id,
|
||||
|
||||
## Directories
|
||||
DISCOURSE_REPOSITORY_DIR: "{{ docker_compose.directories.services }}{{ applications | get_app_conf( application_id, 'repository') }}/"
|
||||
DISCOURSE_CONTAINERS_DIR: "{{ DISCOURSE_REPOSITORY_DIR }}/containers/"
|
||||
DISCOURSE_CONTAINERS_DIR: "{{ [ DISCOURSE_REPOSITORY_DIR, 'containers' ] | path_join }}"
|
||||
|
||||
## Files
|
||||
DISCOURSE_APPLICATION_YML_DEST: "{{ DISCOURSE_CONTAINERS_DIR }}{{ DISCOURSE_CONTAINER }}.yml"
|
||||
DISCOURSE_APPLICATION_YML_DEST: "{{ [ DISCOURSE_CONTAINERS_DIR, DISCOURSE_CONTAINER ~ '.yml' ] | path_join }}"
|
||||
|
||||
## Error Strings
|
||||
DISCOURSE_ERROR_ALREADY_IN_NET: "Error response from daemon: endpoint with name {{ DISCOURSE_CONTAINER }} already exists in network {{ DISCOURSE_PG_NETWORK }}"
|
||||
|
@@ -3,7 +3,7 @@
|
||||
command: >
|
||||
docker exec -u {{ WORDPRESS_USER }} {{ WORDPRESS_CONTAINER }}
|
||||
wp core install
|
||||
--url="{{ domains | get_url(application_id, WEB_PROTOCOL) }}"
|
||||
--url="{{ WORDPRESS_URL }}"
|
||||
--title="{{ applications | get_app_conf(application_id, 'title', True) }}"
|
||||
--admin_user="{{ applications | get_app_conf(application_id, 'users.administrator.username') }}"
|
||||
--admin_password="{{ applications | get_app_conf(application_id, 'credentials.administrator_password', True) }}"
|
||||
|
@@ -1,8 +1,10 @@
|
||||
---
|
||||
- name: "Check if plugin has a dedicated install task"
|
||||
- name: "Check if plugin has a dedicated install task under '{{ plugin_task_path }}'"
|
||||
stat:
|
||||
path: "{{ plugin_task_path }}"
|
||||
register: plugin_task_file
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
|
||||
- name: "Include plugin-specific install task if it exists"
|
||||
include_tasks: "{{ plugin_task_path }}"
|
||||
|
@@ -15,16 +15,18 @@
|
||||
vars:
|
||||
docker_compose_flush_handlers: false
|
||||
|
||||
- name: "Transfering upload.ini to {{ docker_compose.directories.instance }}"
|
||||
- name: "Transfering upload.ini to {{ WORDPRESS_CONFIG_UPLD_ABS }}"
|
||||
template:
|
||||
src: upload.ini.j2
|
||||
dest: "{{ docker_compose.directories.instance }}upload.ini"
|
||||
notify: docker compose up
|
||||
dest: "{{ WORDPRESS_CONFIG_UPLD_ABS }}"
|
||||
notify:
|
||||
- docker compose up
|
||||
- docker compose build
|
||||
|
||||
- name: "Transfering msmtprc to {{ WORDPRESS_HOST_MSMTP_CONF }}"
|
||||
- name: "Transfering msmtprc to {{ WORDPRESS_MSMTP_ABS }}"
|
||||
template:
|
||||
src: "{{ playbook_dir }}/roles/sys-svc-msmtp/templates/msmtprc.conf.j2"
|
||||
dest: "{{ WORDPRESS_HOST_MSMTP_CONF }}"
|
||||
src: "{{ WORDPRESS_MSMTP_SRC }}"
|
||||
dest: "{{ WORDPRESS_MSMTP_ABS }}"
|
||||
notify: docker compose up
|
||||
|
||||
- name: Flush handlers to make {{ WORDPRESS_CONFIG_FILE }} available before patch
|
||||
@@ -53,7 +55,7 @@
|
||||
vars:
|
||||
plugin_name: "{{ item.key }}"
|
||||
plugin_enabled: "{{ item.value.enabled | bool }}"
|
||||
plugin_task_path: "{{ role_path }}/tasks/plugins/{{ plugin_name }}/install.yml"
|
||||
plugin_task_path: "{{ [role_path, 'tasks/plugins', plugin_name ~ '.yml' ] | path_join }}"
|
||||
when: plugin_enabled
|
||||
|
||||
- name: Detect if WordPress is Multisite
|
||||
@@ -68,5 +70,5 @@
|
||||
when: (wp_is_multisite.stdout | trim) == '0'
|
||||
vars:
|
||||
# Target URL to switch to (uses your helper)
|
||||
wp_new_url: "{{ domains | get_url(application_id, WEB_PROTOCOL) }}"
|
||||
wp_new_url: "{{ WORDPRESS_URL }}"
|
||||
|
||||
|
@@ -11,4 +11,4 @@ RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli
|
||||
mv wp-cli.phar /usr/local/bin/wp
|
||||
|
||||
# Copy PHP upload settings
|
||||
COPY upload.ini $PHP_INI_DIR/conf.d/
|
||||
COPY {{ WORDPRESS_CONFIG_UPLD_REL }} $PHP_INI_DIR/conf.d/
|
@@ -10,7 +10,7 @@
|
||||
- "127.0.0.1:{{ ports.localhost.http[application_id] }}:80"
|
||||
volumes:
|
||||
- data:{{ WORDPRESS_DOCKER_HTML_PATH }}
|
||||
- {{ WORDPRESS_HOST_MSMTP_CONF }}:/etc/msmtprc
|
||||
- {{ WORDPRESS_MSMTP_ABS }}:/etc/msmtprc
|
||||
|
||||
{% include 'roles/docker-container/templates/healthcheck/msmtp_curl.yml.j2' %}
|
||||
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
|
||||
|
@@ -2,8 +2,10 @@
|
||||
application_id: "web-app-wordpress"
|
||||
database_type: "mariadb"
|
||||
|
||||
# WordPress Specific
|
||||
WORDPRESS_HOST_MSMTP_CONF: "{{ [ docker_compose.directories.config, 'msmtprc.conf'] | path_join }}"
|
||||
# WordPress
|
||||
WORDPRESS_URL: "{{ domains | get_url(application_id, WEB_PROTOCOL) }}"
|
||||
WORDPRESS_MSMTP_SRC: "{{ [ playbook_dir, 'roles/sys-svc-msmtp/templates/msmtprc.conf.j2' ] | path_join }}"
|
||||
WORDPRESS_MSMTP_ABS: "{{ [ docker_compose.directories.config, 'msmtprc.conf'] | path_join }}"
|
||||
WORDPRESS_MAX_UPLOAD_SIZE: "{{ applications | get_app_conf(application_id, 'max_upload_size') }}"
|
||||
WORDPRESS_CUSTOM_IMAGE: "wordpress_custom"
|
||||
WORDPRESS_DOCKER_HTML_PATH: "/var/www/html"
|
||||
@@ -17,3 +19,5 @@ WORDPRESS_PLUGINS: "{{ applications | get_app_conf(application_id, 'plu
|
||||
WORDPRESS_USER: "www-data"
|
||||
WORDPRESS_CONFIG_FILE: "wp-config.php"
|
||||
WORDPRESS_CONFIG_PATH: "{{ [WORDPRESS_DOCKER_HTML_PATH, WORDPRESS_CONFIG_FILE] | path_join }}"
|
||||
WORDPRESS_CONFIG_UPLD_REL: "config/upload.ini"
|
||||
WORDPRESS_CONFIG_UPLD_ABS: "{{ [docker_compose.directories.instance, WORDPRESS_CONFIG_UPLD_REL ] | path_join }}"
|
@@ -1,4 +1,3 @@
|
||||
# vars/oidc.yml
|
||||
# Defines OIDC settings for the OpenID Connect Generic plugin, with explanatory comments.
|
||||
# @see https://github.com/oidc-wp/openid-connect-generic/blob/develop/includes/openid-connect-dev-option-settings.php
|
||||
|
||||
|
Reference in New Issue
Block a user