Files
computer-playbook/roles/web-app-friendica/tasks/03_addons.yml
Kevin Veen-Birkenbach 9082443753 Refactor docker compose exec usage
Introduce centralized variables:
- docker_compose_command_base
- docker_compose_command_exec

Replaced hardcoded 'docker compose exec' with '{{ docker_compose_command_exec }}'
across multiple roles (BigBlueButton, EspoCRM, Friendica, Listmonk, Mailu, Matrix, OpenProject).
Ensures consistent environment file loading and reduces duplicated code.

Details: https://chatgpt.com/share/68d6a276-19d0-800f-839d-d191d97f7c41
2025-09-26 16:26:17 +02:00

35 lines
1.2 KiB
YAML

- name: flush handlers to ensure that friendica is up before friendica addon configuration
meta: flush_handlers
- name: Build friendica_addons based on features
set_fact:
friendica_addons: >-
{{
friendica_addons | default([])
+ [{
'name': item.key,
'enabled': (
applications | get_app_conf(application_id, 'features.oidc', True)
if item.key == 'keycloakpassword'
else applications | get_app_conf(application_id, 'features.ldap', True)
if item.key == 'ldapauth'
else (item.value.enabled if item.value is mapping and 'enabled' in item.value else False)
)
}]
}}
loop: "{{ applications | get_app_conf(application_id, 'addons', True) | dict2items }}"
loop_control:
label: "{{ item.key }}"
- name: Ensure Friendica addons are in sync
command: >
{{ docker_compose_command_exec }} --user {{ friendica_user }}
application
bin/console addon
{{ 'enable' if item.enabled else 'disable' }}
{{ item.name }}
args:
chdir: "{{ docker_compose.directories.instance }}"
loop: "{{ friendica_addons }}"
loop_control:
label: "{{ item.name }}"