Files
computer-playbook/roles/web-app-friendica/tasks/01_manager_ops.yml
kevinveenbirkenbachandClaude Opus 5 3cc032fd1e refactor(layout): fold the persisted-credential patches into a patch/ folder
1f870b1e5 left two marks the layout rules reject. friendica's utils/ held
patch_config.yml beside patch_db_credentials.yml, which is a shared
delimiter-bounded prefix, and its numbered files ran 00, 01, 02, 04, 05 with
nothing at 03 after the config patch moved out of the sequence.

The prefix becomes the folder it was standing in for, the way 8e8dbbd08c did it
for the AI files. All four roles move, not only the one the lint could see: the
path post_deploy.yml resolves a role's declaration through has to read the same
everywhere, so a folder in one role and a prefix in the other three would be no
domain at all.

  utils/patch_db_credentials.yml -> utils/patch/db_credentials.yml   (4 roles)
  utils/patch_config.yml         -> utils/patch/config.yml           (friendica)

The numbers close up behind the file that left: 04_addons and 05_user_bootstrap
become 03 and 04.

Four references follow: the include in 01_manager_ops.yml, the lookup in
post_deploy.yml, the caller path in the unit test that reads each role's
declaration, and a requirement doc that linked the old addon file.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 01:54:25 +02:00

79 lines
3.1 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
- name: "📄 Deploy '{{ FRIENDICA_INIT_GATE_HOST }}'"
copy:
src: "shell/{{ FRIENDICA_INIT_GATE_FILE }}"
dest: "{{ FRIENDICA_INIT_GATE_HOST }}"
mode: "0755"
notify:
- compose-build
- compose-up
- name: 🔗 Integrate LDAP
include_tasks: 02_ldap.yml
when: FRIENDICA_LDAP_ENABLED | bool
- name: "🔄 Flush handlers so '{{ FRIENDICA_CONTAINER }}' is up before container tasks"
meta: flush_handlers
- name: "🔍 Resolve friendica hosting node + container id"
ansible.builtin.include_tasks: "{{ lookup('path_absolute', 'roles/sys-svc-compose/tasks/utils/swarm/resolve_host_cid.yml') }}"
vars:
resolve_service_key: friendica
resolve_output_prefix: FRIENDICA
resolve_compose_cid: "{{ FRIENDICA_CONTAINER }}"
- name: "🗑️ Remove stale ldapauth.config.php leftover when LDAP is disabled"
shell: > # nocheck: container-exec-resolver FRIENDICA_LOCAL_CID resolved at delegate_to runtime
container exec --user root {{ FRIENDICA_LOCAL_CID | quote }}
rm -f {{ FRIENDICA_LDAP_CONFIG_DOCKER }}
delegate_to: "{{ FRIENDICA_HOST_NODE }}"
register: friendica_ldap_config_cleanup
changed_when: friendica_ldap_config_cleanup.rc == 0
when: not (FRIENDICA_LDAP_ENABLED | bool)
- name: 🔎 Check if Friendica local.config.php exists
shell: > # nocheck: container-exec-resolver FRIENDICA_LOCAL_CID resolved at delegate_to runtime
container exec --user {{ FRIENDICA_USER }} {{ FRIENDICA_LOCAL_CID | quote }} test -f {{ FRIENDICA_CONFIG_FILE }}
delegate_to: "{{ FRIENDICA_HOST_NODE }}"
register: friendica_config_exists
changed_when: false
failed_when: false
- name: 🩹 Patch Friendica local.config.php with updated DB credentials
ansible.builtin.include_tasks:
file: utils/patch/config.yml
apply:
notify: compose-up
when: friendica_config_exists.rc == 0
- name: ➕ Add Friendica Add Ons
include_tasks: 03_addons.yml
- name: "🎬 Bootstrap Friendica admin user (only when no LDAP provider provisions them)"
include_tasks: 04_user_bootstrap.yml
when: not (FRIENDICA_LDAP_ENABLED | bool)
- name: "📧 Verify the relay accepted Friendica's startup mail"
when: lookup('config', application_id, 'services.email.enabled', false) | bool
block:
- name: "⏳ Wait for the delivery marker the healthcheck writes"
shell: > # nocheck: container-exec-resolver FRIENDICA_LOCAL_CID resolved at delegate_to runtime
container exec {{ FRIENDICA_LOCAL_CID | quote }} test -f {{ lookup('container_mail_marker') }}
delegate_to: "{{ FRIENDICA_HOST_NODE }}"
register: friendica_smoke_mail
changed_when: false
failed_when: false
retries: 30
delay: 5
until: friendica_smoke_mail.rc == 0
- name: "🛑 Report a relay that refused every attempt"
ansible.builtin.assert:
that: friendica_smoke_mail.rc == 0
fail_msg: >-
Friendica never delivered its startup mail. The healthcheck writes
{{ lookup('container_mail_marker') }} only after msmtp exits 0, so
the relay refused every attempt. Its reason is in the container's
State.Health.Log; liveness itself is unaffected, which is why the
stack still converged.