mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-29 22:37:29 +00:00
Strip every `req <NNN>`, `req-<NNN>`, `Requirement <NNN>`, `requirement-<NNN>`, and `docs/requirements/<NNN>-...md` mention from non-Markdown source files. Comments anchored to requirement numbers rot when requirements are renumbered or rewritten and conflate present-state behaviour (which the comment should describe) with the audit trail of how the code got there (which belongs in commit messages, PR descriptions, and the requirement file itself). * Document the rule in `docs/contributing/documentation.md` under "Comments". Code MUST describe the *why* in present-state language; contract enforcement lives in tests, not folklore. * Clean 254 source files across `roles/`, `tests/`, `plugins/`, `cli/`, `scripts/`, `utils/`, `group_vars/`, and the repo-root `eslint.config.js`. Pure comment / docstring / log-message edits; no behavioural change. * Add `tests/lint/repository/test_no_req_references_in_code.py` to enforce the rule going forward across `.js`, `.py`, `.yml`, `.yaml`, `.j2`, and `.sh` files. The legacy `test_no_stale_requirement_refs.py` is exempt as the only file whose purpose is to detect these very tokens. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
85 lines
2.7 KiB
YAML
85 lines
2.7 KiB
YAML
---
|
|
- name: "Include role sys-stk-front-proxy for {{ application_id }}"
|
|
include_role:
|
|
name: sys-stk-front-proxy
|
|
loop: "{{ WORDPRESS_DOMAINS }}"
|
|
loop_control:
|
|
loop_var: domain
|
|
vars:
|
|
webserver_extra_configuration: "client_max_body_size {{ WORDPRESS_MAX_UPLOAD_SIZE }};"
|
|
http_port: "{{ lookup('config', application_id, 'services.wordpress.ports.local.http') }}"
|
|
|
|
- name: "load docker and db for {{ application_id }}"
|
|
include_role:
|
|
name: sys-stk-backend
|
|
vars:
|
|
docker_compose_flush_handlers: false
|
|
|
|
- name: "Transfering upload.ini to {{ WORDPRESS_CONFIG_UPLD_ABS }}"
|
|
template:
|
|
src: upload.ini.j2
|
|
dest: "{{ WORDPRESS_CONFIG_UPLD_ABS }}"
|
|
notify:
|
|
- compose up
|
|
- compose build
|
|
|
|
- name: "Transfering msmtprc to {{ WORDPRESS_MSMTP_ABS }}"
|
|
template:
|
|
src: "{{ WORDPRESS_MSMTP_SRC }}"
|
|
dest: "{{ WORDPRESS_MSMTP_ABS }}"
|
|
notify: compose up
|
|
|
|
- name: Flush handlers to make {{ WORDPRESS_CONFIG_FILE }} available before patch
|
|
meta: flush_handlers
|
|
|
|
- name: Check if {{ WORDPRESS_CONFIG_FILE }} exists in WordPress
|
|
command: >
|
|
container exec -u {{ WORDPRESS_USER }} {{ WORDPRESS_CONTAINER }} test -f {{ WORDPRESS_CONFIG_PATH }}
|
|
register: wp_config_file_exists
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Patch WordPress {{ WORDPRESS_CONFIG_FILE }} with updated DB credentials
|
|
include_tasks: 01_patch_config.yml
|
|
when: wp_config_file_exists.rc == 0
|
|
|
|
- name: "Install wordpress"
|
|
include_tasks: 02_install.yml
|
|
|
|
- name: "Convert to Multisite when opted in"
|
|
include_tasks: 06_multisite.yml
|
|
when: >-
|
|
(lookup('config', application_id, 'services.wordpress.multisite.enabled')
|
|
| default(false) | bool)
|
|
|
|
- name: "Install mu-plugins (OIDC→RBAC role mapper)"
|
|
include_tasks: 05_mu_plugins.yml
|
|
|
|
- name: "Install and activate WordPress plugins"
|
|
block:
|
|
- name: "Iterate through WordPress plugins"
|
|
include_tasks: 03_enable_plugin.yml
|
|
loop: "{{ WORDPRESS_PLUGINS }}"
|
|
loop_control:
|
|
loop_var: wordpress_plugin
|
|
label: "{{ wordpress_plugin.key }}"
|
|
vars:
|
|
plugin_name: "{{ wordpress_plugin.key }}"
|
|
plugin_enabled: "{{ wordpress_plugin.value.enabled | bool }}"
|
|
plugin_task_path: "{{ [role_path, 'tasks/plugins', plugin_name ~ '.yml' ] | path_join }}"
|
|
when: plugin_enabled | bool
|
|
|
|
- name: Detect if WordPress is Multisite
|
|
command: >
|
|
container exec -u {{ WORDPRESS_USER }} {{ WORDPRESS_CONTAINER }}
|
|
wp eval 'echo (int) is_multisite();' --path={{ WORDPRESS_DOCKER_HTML_PATH }}
|
|
register: wp_is_multisite
|
|
changed_when: false
|
|
|
|
- name: "Update Single Side WordPress domain"
|
|
include_tasks: 04_update_domain.yml
|
|
when: (wp_is_multisite.stdout | trim) == '0'
|
|
vars:
|
|
# Target URL to switch to (uses your helper)
|
|
wp_new_url: "{{ WORDPRESS_URL }}"
|