Files
computer-playbook/roles/web-app-pixelfed/tasks/04_oidc_mapping.yml
kevinveenbirkenbachandClaude Opus 4.8 cddb0dc59b feat(lint): require emoji-prefixed task/step/job names + convert existing
Add tests/lint/repository/test_name_emoji_and_length.py: every Ansible task
name and GitHub Actions workflow/job/step name must start with an emoji (first
char not 0-9/A-Za-z) and be <= 80 chars.

- emit emoji names at the source: cli/build/include generator now writes
  "🔧 setup <app>" / "🚿 flush handlers after <app>" so generated
  tasks/groups/*-roles.yml satisfy the convention too
- convert existing task/step/job/workflow names to emoji-prefixed, choosing a
  task-fitting icon per action (📦 install, ✅ ensure, 🔍 probe, 🥾 bootstrap,
  🚀 deploy, 🧩 service-module load, ⬇️ checkout, 📂 include-routines, ...)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 22:45:06 +02:00

49 lines
2.0 KiB
YAML

---
# Persist the OIDC mapping for the Pixelfed administrator user. SQL
# bodies live in roles/web-app-pixelfed/files/sql/*.sql and are loaded
# via `query_file:` so the same task shape works whether Pixelfed's DB
# runs in a central `svc-db-*` container or a per-role
# `<entity>-database` container — the database_query module hands the
# query off to whichever the `database` lookup resolves to.
- name: "⏳ Wait until the Pixelfed OIDC mapping table exists"
database_query:
config: "{{ lookup('database', application_id) }}"
query_file: "{{ role_path }}/files/sql/oidc-mapping/select-table.sql"
named_args:
db_name: "{{ PIXELFED_DB_NAME }}"
expect_rows: true
mask_values: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
register: pixelfed_admin_oidc_table
changed_when: false
retries: 60
delay: 5
until: pixelfed_admin_oidc_table.rows | length > 0
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "✅ Verify the Pixelfed OIDC mapping table contains the expected columns"
database_query:
config: "{{ lookup('database', application_id) }}"
query_file: "{{ role_path }}/files/sql/oidc-mapping/count-columns.sql"
named_args:
db_name: "{{ PIXELFED_DB_NAME }}"
expect_rows: true
mask_values: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
register: pixelfed_admin_oidc_columns
changed_when: false
failed_when: (pixelfed_admin_oidc_columns.rows[0][0] | int) != 4
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "✅ Ensure the Pixelfed administrator OIDC mapping exists"
database_query:
config: "{{ lookup('database', application_id) }}"
query_file: "{{ role_path }}/files/sql/oidc-mapping/upsert.sql"
named_args:
user_id: "{{ pixelfed_admin_id.rows[0][0] | int }}"
oidc_id: "{{ PIXELFED_ADMIN_OIDC_ID }}"
expect_rows: true
mask_values: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
register: pixelfed_admin_oidc_mapping
changed_when: (pixelfed_admin_oidc_mapping.rows[-1][0] | int) > 0
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"