Files
computer-playbook/roles/web-app-pixelfed/tasks/03_administrator.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

64 lines
2.2 KiB
YAML

---
- name: "⏳ Wait until the Pixelfed users table exists"
database_query:
config: "{{ lookup('database', application_id) }}"
query_file: "{{ role_path }}/files/sql/select/users-table.sql"
named_args:
db_name: "{{ PIXELFED_DB_NAME }}"
expect_rows: true
mask_values: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
register: pixelfed_users_table
changed_when: false
retries: 60
delay: 5
until: pixelfed_users_table.rows | length > 0
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "🔎 Check whether the Pixelfed administrator already exists"
database_query:
config: "{{ lookup('database', application_id) }}"
query_file: "{{ role_path }}/files/sql/select/admin-id.sql"
named_args:
admin_username: "{{ PIXELFED_ADMIN_USERNAME }}"
expect_rows: true
mask_values: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
register: pixelfed_admin_id_existing
changed_when: false
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "📁 Create the Pixelfed administrator via artisan"
ansible.builtin.command:
argv:
- container
- exec
- -u
- "{{ PIXELFED_APP_USER }}"
- "{{ PIXELFED_LOCAL_CID }}" # nocheck: container-exec-resolver PIXELFED_LOCAL_CID resolved at delegate_to runtime
- php
- artisan
- user:create
- "--name={{ PIXELFED_ADMIN_NAME }}"
- "--username={{ PIXELFED_ADMIN_USERNAME }}"
- "--email={{ PIXELFED_ADMIN_EMAIL }}"
- "--password={{ PIXELFED_ADMIN_PASSWORD }}"
- --is_admin=1
- --confirm_email=1
when: pixelfed_admin_id_existing.rows | length == 0
register: pixelfed_admin_create
changed_when: pixelfed_admin_create.rc == 0
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
delegate_to: "{{ PIXELFED_HOST_NODE }}"
- name: "🔍 Resolve the Pixelfed administrator id"
database_query:
config: "{{ lookup('database', application_id) }}"
query_file: "{{ role_path }}/files/sql/select/admin-id.sql"
named_args:
admin_username: "{{ PIXELFED_ADMIN_USERNAME }}"
expect_rows: true
mask_values: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
register: pixelfed_admin_id
changed_when: false
failed_when: pixelfed_admin_id.rows | length == 0
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"