mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
Resolve every 3+-file same-prefix group flagged by the new prefix lint
by moving the files into a subfolder named after the shared prefix and
dropping the prefix from the file names, updating all references:
- utils/env/handlers/infinito_*.py -> infinito/ (dir/, package_cache/
nested a second level); registry imports and the four handler-dir
globs switched to iter_project_files
- utils/install/lint/ansible_*.py -> ansible/ (aliased imports)
- roles/sys-svc-compose/files/swarm_*.{py,sh} -> files/swarm/
- web-app-erpnext/web-app-zammad files/scripts/apply_*.{py,rb} -> apply/
- web-app-odoo files/sql/{select,update}-* and sql/oidc/{grant,insert,
select,update}-* -> matching subfolders
- web-app-keycloak tasks/update/05_ldap*.yml -> 05_ldap/ (internal
includes made role_path-absolute)
- plugins/filter/get_*.py -> plugins/filter/get/ (filter names are the
filters() dict keys, so Jinja usage is unaffected; ansible discovers
the one-level-deep subdir)
Ansible lookup dirs, addon dirs and .github/workflows keep their flat
layout (the filename is the public id / GitHub only discovers flat).
Unit tests mirror the new source layout.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
31 lines
1.0 KiB
YAML
31 lines
1.0 KiB
YAML
---
|
|
- name: "⬇️ Fetch existing Keycloak components for '{{ KEYCLOAK_REALM }}'"
|
|
shell: >
|
|
{{ KEYCLOAK_EXEC_KCADM }} get components -r {{ KEYCLOAK_REALM }} --format json
|
|
register: kc_components_without_ldap
|
|
changed_when: false
|
|
|
|
- name: "🔍 Resolve LDAP federation component ids for '{{ KEYCLOAK_REALM }}'"
|
|
set_fact:
|
|
ldap_cmp_ids_without_ldap: >-
|
|
{{
|
|
(
|
|
kc_components_without_ldap.stdout | kcadm_json
|
|
| selectattr('providerType','equalto','org.keycloak.storage.UserStorageProvider')
|
|
| selectattr('providerId','equalto','ldap')
|
|
| map(attribute='id')
|
|
| list
|
|
)
|
|
}}
|
|
changed_when: false
|
|
|
|
- name: "🧹 Delete LDAP federation components from realm '{{ KEYCLOAK_REALM }}'"
|
|
shell: >
|
|
{{ KEYCLOAK_EXEC_KCADM }} delete components/{{ item }} -r {{ KEYCLOAK_REALM }}
|
|
loop: "{{ ldap_cmp_ids_without_ldap }}"
|
|
loop_control:
|
|
label: "{{ item }}"
|
|
register: kc_delete_ldap_components
|
|
changed_when: kc_delete_ldap_components.rc == 0
|
|
failed_when: kc_delete_ldap_components.rc != 0
|