mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Huge role refactoring/cleanup. Other commits will propably follow. Because some bugs will exist. Still important for longrun and also for auto docs/help/slideshow generation
This commit is contained in:
56
roles/web-app-friendica/tasks/main.yml
Normal file
56
roles/web-app-friendica/tasks/main.yml
Normal file
@@ -0,0 +1,56 @@
|
||||
---
|
||||
- name: "include service-rdbms-central"
|
||||
include_role:
|
||||
name: service-rdbms-central
|
||||
|
||||
- name: "create {{ friendica_host_ldap_config }}"
|
||||
template:
|
||||
src: "ldapauth.config.php.j2"
|
||||
dest: "{{ friendica_host_ldap_config }}"
|
||||
mode: '644'
|
||||
owner: root
|
||||
group: 33
|
||||
force: yes
|
||||
notify: docker compose up
|
||||
when: applications | is_feature_enabled('ldap',application_id)
|
||||
|
||||
- name: "include role webserver-proxy-domain for {{application_id}}"
|
||||
include_role:
|
||||
name: webserver-proxy-domain
|
||||
vars:
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: Build friendica_addons based on features
|
||||
set_fact:
|
||||
friendica_addons: >-
|
||||
{{
|
||||
friendica_addons | default([])
|
||||
+ [{
|
||||
'name': item.key,
|
||||
'enabled': (
|
||||
applications[application_id].features.oidc
|
||||
if item.key == 'keycloakpassword'
|
||||
else applications[application_id].features.ldap
|
||||
if item.key == 'ldapauth'
|
||||
else (item.value.enabled if item.value is mapping and 'enabled' in item.value else False)
|
||||
)
|
||||
}]
|
||||
}}
|
||||
loop: "{{ applications[application_id].addons | dict2items }}"
|
||||
loop_control:
|
||||
label: "{{ item.key }}"
|
||||
|
||||
- name: Ensure Friendica addons are in sync
|
||||
command: >
|
||||
docker compose exec --user www-data
|
||||
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 }}"
|
||||
|
Reference in New Issue
Block a user