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>
104 lines
3.1 KiB
YAML
104 lines
3.1 KiB
YAML
---
|
|
- name: "✅ Ensure Fediwall build dir '{{ FEDIWALL_BUILD_DIR_ABS }}' exists"
|
|
file:
|
|
path: "{{ FEDIWALL_BUILD_DIR_ABS }}"
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: "⬇️ Download Fediwall {{ FEDIWALL_UPSTREAM_VERSION }} release tarball"
|
|
get_url_retry:
|
|
url: "{{ FEDIWALL_UPSTREAM_TARBALL_URL }}"
|
|
dest: "{{ FEDIWALL_TARBALL_FILE }}"
|
|
mode: "0644"
|
|
notify:
|
|
- compose-build
|
|
- compose-up
|
|
|
|
- name: "✅ Ensure Fediwall upstream dir '{{ FEDIWALL_UPSTREAM_DIR_ABS }}' exists"
|
|
file:
|
|
path: "{{ FEDIWALL_UPSTREAM_DIR_ABS }}"
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: "📤 Extract Fediwall tarball into '{{ FEDIWALL_UPSTREAM_DIR_ABS }}'"
|
|
unarchive:
|
|
src: "{{ FEDIWALL_TARBALL_FILE }}"
|
|
dest: "{{ FEDIWALL_UPSTREAM_DIR_ABS }}"
|
|
remote_src: true
|
|
extra_opts:
|
|
- --strip-components=1
|
|
notify:
|
|
- compose-build
|
|
- compose-up
|
|
|
|
- name: "🔧 De-hardcode https in the Fediwall SPA bundles (HTTP-only)"
|
|
when: FEDIWALL_HTTP_ONLY_ENABLED | bool
|
|
block:
|
|
- name: "🔍 Find built Fediwall JS bundles to de-hardcode https"
|
|
find:
|
|
paths: "{{ [ FEDIWALL_UPSTREAM_DIR_ABS, 'assets' ] | path_join }}"
|
|
patterns: "*.js"
|
|
register: _fediwall_assets
|
|
|
|
- name: "✏️ Rewrite the SPA's hardcoded https:// API scheme to the page's own protocol"
|
|
replace:
|
|
path: "{{ item.path }}"
|
|
regexp: '"https://"\.concat'
|
|
replace: '(location.protocol+"//").concat'
|
|
loop: "{{ _fediwall_assets.files | default([]) }}"
|
|
loop_control:
|
|
label: "{{ item.path | basename }}"
|
|
notify:
|
|
- compose-build
|
|
- compose-up
|
|
|
|
- name: "🧹 Wipe Fediwall dist tree '{{ FEDIWALL_DIST_DIR_ABS }}' to drop removed slugs"
|
|
file:
|
|
path: "{{ FEDIWALL_DIST_DIR_ABS }}"
|
|
state: absent
|
|
|
|
- name: "📁 Recreate Fediwall dist tree '{{ FEDIWALL_DIST_DIR_ABS }}'"
|
|
file:
|
|
path: "{{ FEDIWALL_DIST_DIR_ABS }}"
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: "🎬 Stage upstream Fediwall files into per-slug folder '{{ wall.slug }}'"
|
|
copy: # nocheck: stack-host-consumer (01_manager_ops.yml is parent-gated by IS_STACK_HOST in 00_core.yml:11)
|
|
src: "{{ FEDIWALL_UPSTREAM_DIR_ABS }}/"
|
|
dest: "{{ [ FEDIWALL_DIST_DIR_ABS, wall.slug ] | path_join }}/"
|
|
remote_src: true
|
|
mode: preserve
|
|
loop: "{{ FEDIWALL_WALLS }}"
|
|
loop_control:
|
|
loop_var: wall
|
|
label: "{{ wall.slug }}"
|
|
notify:
|
|
- compose-build
|
|
- compose-up
|
|
|
|
- name: "📄 Render per-slug Fediwall wall-config.json for '{{ wall.slug }}'"
|
|
stack_host_template:
|
|
src: "wall-config.json.j2"
|
|
dest: "{{ [ FEDIWALL_DIST_DIR_ABS, wall.slug, 'wall-config.json' ] | path_join }}"
|
|
mode: "0644"
|
|
loop: "{{ FEDIWALL_WALLS }}"
|
|
loop_control:
|
|
loop_var: wall
|
|
label: "{{ wall.slug }}"
|
|
notify:
|
|
- compose-build
|
|
- compose-up
|
|
|
|
- name: "📄 Render Fediwall root link list at '{{ FEDIWALL_DIST_DIR_ABS }}/index.html'"
|
|
stack_host_template:
|
|
src: "index.html.j2"
|
|
dest: "{{ [ FEDIWALL_DIST_DIR_ABS, 'index.html' ] | path_join }}"
|
|
mode: "0644"
|
|
notify:
|
|
- compose-build
|
|
- compose-up
|
|
|
|
- name: "🚿 flush compose for '{{ application_id }}'"
|
|
meta: flush_handlers
|