mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-31 15:48:57 +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
|
## Directories
|
||||||
DISCOURSE_REPOSITORY_DIR: "{{ docker_compose.directories.services }}{{ applications | get_app_conf( application_id, 'repository') }}/"
|
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
|
## 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
|
## Error Strings
|
||||||
DISCOURSE_ERROR_ALREADY_IN_NET: "Error response from daemon: endpoint with name {{ DISCOURSE_CONTAINER }} already exists in network {{ DISCOURSE_PG_NETWORK }}"
|
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: >
|
command: >
|
||||||
docker exec -u {{ WORDPRESS_USER }} {{ WORDPRESS_CONTAINER }}
|
docker exec -u {{ WORDPRESS_USER }} {{ WORDPRESS_CONTAINER }}
|
||||||
wp core install
|
wp core install
|
||||||
--url="{{ domains | get_url(application_id, WEB_PROTOCOL) }}"
|
--url="{{ WORDPRESS_URL }}"
|
||||||
--title="{{ applications | get_app_conf(application_id, 'title', True) }}"
|
--title="{{ applications | get_app_conf(application_id, 'title', True) }}"
|
||||||
--admin_user="{{ applications | get_app_conf(application_id, 'users.administrator.username') }}"
|
--admin_user="{{ applications | get_app_conf(application_id, 'users.administrator.username') }}"
|
||||||
--admin_password="{{ applications | get_app_conf(application_id, 'credentials.administrator_password', True) }}"
|
--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:
|
stat:
|
||||||
path: "{{ plugin_task_path }}"
|
path: "{{ plugin_task_path }}"
|
||||||
register: plugin_task_file
|
register: plugin_task_file
|
||||||
|
delegate_to: localhost
|
||||||
|
become: false
|
||||||
|
|
||||||
- name: "Include plugin-specific install task if it exists"
|
- name: "Include plugin-specific install task if it exists"
|
||||||
include_tasks: "{{ plugin_task_path }}"
|
include_tasks: "{{ plugin_task_path }}"
|
||||||
|
@@ -15,16 +15,18 @@
|
|||||||
vars:
|
vars:
|
||||||
docker_compose_flush_handlers: false
|
docker_compose_flush_handlers: false
|
||||||
|
|
||||||
- name: "Transfering upload.ini to {{ docker_compose.directories.instance }}"
|
- name: "Transfering upload.ini to {{ WORDPRESS_CONFIG_UPLD_ABS }}"
|
||||||
template:
|
template:
|
||||||
src: upload.ini.j2
|
src: upload.ini.j2
|
||||||
dest: "{{ docker_compose.directories.instance }}upload.ini"
|
dest: "{{ WORDPRESS_CONFIG_UPLD_ABS }}"
|
||||||
notify: docker compose up
|
notify:
|
||||||
|
- docker compose up
|
||||||
|
- docker compose build
|
||||||
|
|
||||||
- name: "Transfering msmtprc to {{ WORDPRESS_HOST_MSMTP_CONF }}"
|
- name: "Transfering msmtprc to {{ WORDPRESS_MSMTP_ABS }}"
|
||||||
template:
|
template:
|
||||||
src: "{{ playbook_dir }}/roles/sys-svc-msmtp/templates/msmtprc.conf.j2"
|
src: "{{ WORDPRESS_MSMTP_SRC }}"
|
||||||
dest: "{{ WORDPRESS_HOST_MSMTP_CONF }}"
|
dest: "{{ WORDPRESS_MSMTP_ABS }}"
|
||||||
notify: docker compose up
|
notify: docker compose up
|
||||||
|
|
||||||
- name: Flush handlers to make {{ WORDPRESS_CONFIG_FILE }} available before patch
|
- name: Flush handlers to make {{ WORDPRESS_CONFIG_FILE }} available before patch
|
||||||
@@ -53,7 +55,7 @@
|
|||||||
vars:
|
vars:
|
||||||
plugin_name: "{{ item.key }}"
|
plugin_name: "{{ item.key }}"
|
||||||
plugin_enabled: "{{ item.value.enabled | bool }}"
|
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
|
when: plugin_enabled
|
||||||
|
|
||||||
- name: Detect if WordPress is Multisite
|
- name: Detect if WordPress is Multisite
|
||||||
@@ -68,5 +70,5 @@
|
|||||||
when: (wp_is_multisite.stdout | trim) == '0'
|
when: (wp_is_multisite.stdout | trim) == '0'
|
||||||
vars:
|
vars:
|
||||||
# Target URL to switch to (uses your helper)
|
# 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
|
mv wp-cli.phar /usr/local/bin/wp
|
||||||
|
|
||||||
# Copy PHP upload settings
|
# 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"
|
- "127.0.0.1:{{ ports.localhost.http[application_id] }}:80"
|
||||||
volumes:
|
volumes:
|
||||||
- data:{{ WORDPRESS_DOCKER_HTML_PATH }}
|
- 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/healthcheck/msmtp_curl.yml.j2' %}
|
||||||
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
|
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
|
||||||
|
@@ -2,8 +2,10 @@
|
|||||||
application_id: "web-app-wordpress"
|
application_id: "web-app-wordpress"
|
||||||
database_type: "mariadb"
|
database_type: "mariadb"
|
||||||
|
|
||||||
# WordPress Specific
|
# WordPress
|
||||||
WORDPRESS_HOST_MSMTP_CONF: "{{ [ docker_compose.directories.config, 'msmtprc.conf'] | path_join }}"
|
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_MAX_UPLOAD_SIZE: "{{ applications | get_app_conf(application_id, 'max_upload_size') }}"
|
||||||
WORDPRESS_CUSTOM_IMAGE: "wordpress_custom"
|
WORDPRESS_CUSTOM_IMAGE: "wordpress_custom"
|
||||||
WORDPRESS_DOCKER_HTML_PATH: "/var/www/html"
|
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_USER: "www-data"
|
||||||
WORDPRESS_CONFIG_FILE: "wp-config.php"
|
WORDPRESS_CONFIG_FILE: "wp-config.php"
|
||||||
WORDPRESS_CONFIG_PATH: "{{ [WORDPRESS_DOCKER_HTML_PATH, WORDPRESS_CONFIG_FILE] | path_join }}"
|
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.
|
# 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
|
# @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