Files
computer-playbook/roles/sys-svc-cdn/tasks/main.yml
kevinveenbirkenbachandClaude Fable 5 40e553069d refactor(structure): nest prefix-grouped sibling files into subfolders
Move files that share a delimiter-bounded name prefix within a folder (threshold 2) into a subfolder named after the prefix, dropping the prefix from the filename. Covers plugins/filter (docker, generate, has, merge, get/all), env handler subpackages, utils/roles/entity, utils/tests/swarm/write, role SQL/scripts/templates, keycloak/mailu task-includes, shared tasks/utils/load, and CI scripts. Update every import, query_file/script/include_tasks/src/lookup target, compose bind mount, and python -m path to the new locations.

Extend the prefix-grouped-files lint to threshold 2 with dir-level .nocheck and file-head nocheck opt-outs, and skip groups whose shortest member's stem equals the shared prefix. Keep flat only where a loader forbids nesting: WordPress mu-plugins and the docs/requirements namespace. Ansible filter discovery is recursive, so nested filters stay Jinja-resolvable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 20:00:03 +02:00

38 lines
1.0 KiB
YAML

---
- block:
- name: ✅ Ensure shared root and vendor exist (run once)
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: "0755"
loop: "{{ CDN_GLOBAL_DIRS }}"
- include_tasks: utils/once/flag.yml
when:
- run_once_sys_svc_cdn is not defined
- name: 🎛️ Overwritte CDN handlers with neutral handlers
ansible.builtin.include_tasks: "tasks/utils/load/handlers.yml"
loop:
- svc-prx-openresty
- sys-svc-compose
loop_control:
loop_var: handler_role
label: "{{ handler_role }}"
vars:
handler_role_name: "{{ handler_role }}"
- name: ✅ Ensure CDN directories exist
file:
path: "{{ item }}"
state: directory
mode: "0755"
loop: "{{ CDN_ROLE_DIRS }}"
- name: ✅ Ensure 'latest' symlink points to current release
file:
src: "{{ lookup('cdn', application_id).role.release.root }}"
dest: "{{ [lookup('cdn', application_id).role.root, 'latest'] | path_join }}"
state: link
force: true
when: lookup('cdn', application_id).role.version != 'latest'