refactor(web-app-mybb): remove obsolete Installation.md, introduce schema for secret_pin, and rework task/vars handling

- Removed outdated Installation.md (manual plugin instructions no longer needed)
- Added schema/main.yml with validation for secret_pin
- Added config.php.j2 template to manage DB + admin config
- Refactored tasks/main.yml to deploy config.php instead of legacy docker-compose
- Removed setup-domain.yml (TLS/domain handling moved to core roles)
- Updated docker-compose.yml.j2 to mount config.php and use new vars
- Cleaned up vars/main.yml: standardized MYBB_* variable names, added MYBB_SECRET_PIN, config paths, and container port

See ChatGPT conversation: https://chatgpt.com/share/68b0ae26-93ec-800f-8785-0da7c9303090
This commit is contained in:
2025-08-28 21:29:58 +02:00
parent 58c17bf043
commit 92f5bf6481
7 changed files with 68 additions and 116 deletions

View File

@@ -1,36 +1,25 @@
- block:
- name: Include dependency 'srv-proxy-core'
include_role:
name: srv-proxy-core
when: run_once_srv_proxy_core is not defined
- include_tasks: utils/run_once.yml
when: run_once_web_app_mybb is not defined
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
vars:
docker_compose_flush_handlers: false
proxy_extra_configuration: "sub_filter '{{MYBB_DOMAIN}}' '{{ MYBB_DOMAIN }}';"
- name: "include tasks setup-domain.yml with {{ domains | get_domain(application_id) }}"
include_tasks: setup-domain.yml
loop: "{{ mybb_domains + [source_domain] }}"
loop_control:
loop_var: domain
- name: "load docker and db for {{ application_id }}"
include_role:
name: cmp-db-docker
- name: "create {{docker_compose_instance_confd_directory}} and parent directories"
- name: "create {{ MYBB_NGINX_CONF_DIR_HOST }} and parent directories"
file:
path: "{{docker_compose_instance_confd_directory}}"
path: "{{ MYBB_NGINX_CONF_DIR_HOST }}"
state: directory
mode: "0755"
recurse: yes
- name: "create {{docker_compose_instance_confd_defaultconf_file}}"
- name: "Deploy {{ MYBB_NGINX_DEFAULT_CONF_HOST }}"
template:
src: "default.conf.j2"
dest: "{{docker_compose_instance_confd_defaultconf_file}}"
dest: "{{ MYBB_NGINX_DEFAULT_CONF_HOST }}"
notify: docker compose up
- name: add docker-compose.yml
- name: "Deploy {{ MYBB_CONFIG_HOST_PATH }}"
template:
src: "docker-compose.yml.j2"
dest: "{{ docker_compose.directories.instance }}docker-compose.yml"
notify: docker compose up
src: "config.php.j2"
dest: "{{ MYBB_CONFIG_HOST_PATH }}"
mode: '0644'

View File

@@ -1,13 +0,0 @@
- name: "include role receive certbot certificate"
include_role:
name: srv-tls-core
vars:
domain: "{{ domains | get_domain(application_id) }}"
- name: configure {{ domains | get_domain(application_id) }}.conf
template:
src: "roles/srv-proxy-core/templates/vhost/basic.conf.j2"
dest: "{{ NGINX.DIRECTORIES.HTTP.SERVERS }}{{ domains | get_domain(application_id) }}.conf"
notify: restart openresty
vars:
proxy_extra_configuration: "sub_filter '{{source_domain}}' '{{ domains | get_domain(application_id) }}';"