mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
A handler name was doing two jobs at once: the line an operator reads in the
play output, and the identifier a `notify:` binds to. The two pull in opposite
directions -- the log wants "restart the SSH service, with diagnostics", the
binding wants a token that survives quoting, YAML flow style and a shell
round-trip -- and a name that changes for readability silently changes which
handler runs.
Every handler that a notify reached by name now carries a `listen:` with that
exact wording, so the binding is explicit before anything is renamed. The
topics themselves become identifiers: `compose up` reads `compose-up`,
`Restart NFS ganesha` reads `restart-nfs-ganesha`, 22 of them across both
sides of every notify. Where the topic is assembled at runtime, both branches
moved together: the conditional in sys-service carries two literals, and the
LDAP renderer interpolates `import-{{ folder }}-ldif-files`, which is what
makes those handlers reachable at all.
Freed from the binding, the names take the emoji prefix every other task line
already has.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
21 lines
662 B
YAML
21 lines
662 B
YAML
---
|
|
- name: "🔁 Keycloak | Sync LDAP groups (ldap-roles mapper)"
|
|
ansible.builtin.shell: |-
|
|
{{ KEYCLOAK_COMMAND_PERMANENT_ADMIN_LOGIN }}
|
|
{{ KEYCLOAK_EXEC_CONTAINER }} sh -lc '
|
|
set -e
|
|
{{ KEYCLOAK_KCADM }} create \
|
|
"user-storage/{{ ldap_cmp_id | trim }}/mappers/{{ grp_mapper_id | trim }}/sync?direction=fedToKeycloak" \
|
|
-r {{ KEYCLOAK_REALM }}
|
|
'
|
|
listen: sync-ldap-groups
|
|
register: group_sync
|
|
changed_when: true
|
|
retries: 6
|
|
delay: 20
|
|
until: group_sync.rc == 0
|
|
failed_when: group_sync.rc != 0
|
|
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
|
|
delegate_to: "{{ KEYCLOAK_HOST_NODE }}"
|
|
ignore_errors: true
|