Different little optimations

This commit is contained in:
Kevin Veen-Birkenbach 2025-07-17 04:23:05 +02:00
parent 1bdfb71f2f
commit bfc42ce2ac
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
13 changed files with 22 additions and 21 deletions

View File

@ -1,10 +1,10 @@
# Helper variables
_database_id: "svc-db-{{ database_type }}"
_database_central_name: "applications | get_app_conf( _database_id, 'docker.services.' ~ database_type ~ '.name')"
_database_central_name: "{{ applications | get_app_conf( _database_id, 'docker.services.' ~ database_type ~ '.name') }}"
_database_central_user: "{{ database_type }}"
# Definition
database_name: "{{ applications | get_app_conf(database_application_id, 'database.name', false, _database_central_name ) }}" # The overwritte configuration is needed by bigbluebutton
database_name: "{{ applications | get_app_conf( database_application_id, 'database.name', false, _database_central_name ) }}" # The overwritte configuration is needed by bigbluebutton
database_instance: "{{ _database_central_name if applications | get_app_conf(database_application_id, 'features.central_database', False) else database_name }}" # This could lead to bugs at dedicated database @todo cleanup
database_host: "{{ _database_central_name if applications | get_app_conf(database_application_id, 'features.central_database', False) else 'database' }}" # This could lead to bugs at dedicated database @todo cleanup
database_username: "{{ applications | get_app_conf(database_application_id, 'database.username', false, _database_central_user )}}" # The overwritte configuration is needed by bigbluebutton

View File

@ -9,7 +9,7 @@ networks:
applications | get_app_conf(application_id, 'features.ldap', False) and
applications | get_app_conf('svc-db-openldap', 'network.docker', False)
%}
svc-db-openldap:
{{ applications | get_app_conf('svc-db-openldap', 'docker.network') }}:
external: true
{% endif %}
{% if application_id != 'svc-db-openldap' %}

View File

@ -4,7 +4,9 @@
{{ applications | get_app_conf('svc-db-' ~ database_type, 'docker.network') }}:
{% endif %}
{% if applications | get_app_conf(application_id, 'features.ldap', False) and applications | get_app_conf('svc-db-openldap', 'network.docker') %}
svc-db-openldap:
{{ applications | get_app_conf('svc-db-openldap', 'docker.network') }}:
{% endif %}
{% if application_id != 'svc-db-openldap' %}
default:
{% endif %}
{{ "\n" }}

View File

@ -41,9 +41,8 @@
name: "{{ mariadb_name }}"
register: db_info
until:
- db_info.containers is defined
- db_info.containers | length > 0
- db_info.containers[0].State.Health.Status == "healthy"
- db_info.container is defined
- db_info.container.State.Health.Status == "healthy"
retries: 30
delay: 5
when:

View File

@ -2,7 +2,7 @@ application_id: svc-db-mariadb
mariadb_root_pwd: "{{ applications | get_app_conf(application_id,'credentials.root_password', True) }}"
mariadb_init: "{{ database_username is defined and database_password is defined and database_name is defined }}"
mariadb_subnet: "{{ networks.local['svc-db-mariadb'].subnet }}"
mariadb_network_name: "{{ applications | get_app_conf(application_id,'network', True) }}"
mariadb_network_name: "{{ applications | get_app_conf(application_id,'docker.network', True) }}"
mariadb_volume: "{{ applications | get_app_conf(application_id,'docker.volumes.data', True) }}"
mariadb_image: "{{ applications | get_app_conf(application_id,'docker.services.mariadb.image','mariadb', True) }}"
mariadb_version: "{{ applications | get_app_conf(application_id,'docker.services.mariadb.version', True) }}"

View File

@ -19,7 +19,7 @@
- name: create docker network for LDAP, so that other applications can access it
docker_network:
name: "{{ applications | get_app_conf(application_id, 'network', True) }}"
name: "{{ openldap_network }}"
state: present
ipam_config:
- subnet: "{{ networks.local[application_id].subnet }}"

View File

@ -19,5 +19,6 @@ openldap_name: "{{ applications | get_app_conf(application_id,
openldap_image: "{{ applications | get_app_conf(application_id, 'docker.services.openldap.image', True) }}"
openldap_version: "{{ applications | get_app_conf(application_id, 'docker.services.openldap.version', True) }}"
openldap_volume: "{{ applications | get_app_conf(application_id, 'docker.volumes.data', True) }}"
openldap_network: "{{ applications | get_app_conf(application_id, 'docker.network', True) }}"
openldap_network_expose_local: "{{ applications | get_app_conf(application_id, 'network.public', True) | bool or applications | get_app_conf(application_id, 'network.local', True) | bool }}"

View File

@ -3,7 +3,7 @@ postgres_volume: "{{ applications | get_app_conf(application_id, 'docker.
postgres_name: "{{ applications | get_app_conf(application_id, 'docker.services.postgres.name', True) }}"
postgres_image: "{{ applications | get_app_conf(application_id, 'docker.services.postgres.image', True) }}"
postgres_subnet: "{{ networks.local['svc-db-postgres'].subnet }}"
postgres_network_name: "{{ applications | get_app_conf(application_id, 'network', True) }}"
postgres_network_name: "{{ applications | get_app_conf(application_id, 'docker.network', True) }}"
postgres_version: "{{ applications | get_app_conf(application_id, 'docker.services.postgres.version', True) }}"
postgres_password: "{{ applications | get_app_conf(application_id, 'credentials.postgres_password', True) }}"
postgres_port: "{{ database_port | default(ports.localhost.database[ application_id ]) }}"

View File

@ -15,7 +15,7 @@ def get_expected_statuses(domain: str, parts: list[str], redirected_domains: set
Returns:
A list of expected HTTP status codes.
"""
if domain == '{{domains | get_domain('listmonk')}}':
if domain == '{{domains | get_domain('web-app-listmonk')}}':
return [404]
if (parts and parts[0] == 'www') or (domain in redirected_domains):
return [301]

View File

@ -1,6 +1,6 @@
application_id: "web-app-akaunting"
database_type: "mariadb"
database_password: "applications | get_app_conf(application_id, 'credentials.database_password', True)"
database_password: "{{ applications | get_app_conf(application_id, 'credentials.database_password', True) }}"
docker_repository_address: "https://github.com/akaunting/docker.git"
akaunting_version: "{{ applications | get_app_conf(application_id, 'docker.services.akaunting.version', True) }}"
akaunting_image: "{{ applications | get_app_conf(application_id, 'docker.services.akaunting.image', True) }}"

View File

@ -37,8 +37,3 @@
token_auth: "{{ matomo_auth_token }}"
return_content: yes
status_code: 200
- name: run the docker matomo tasks once
set_fact:
run_once_web_app_matomo: true
when: run_once_web_app_matomo is not defined

View File

@ -3,3 +3,7 @@
include_tasks: constructor.yml
when: run_once_web_app_matomo is not defined
- name: run the docker matomo tasks once
set_fact:
run_once_web_app_matomo: true
when: run_once_web_app_matomo is not defined

View File

@ -1,8 +1,8 @@
# Environment File for Matomo
# @see https://hub.docker.com/_/matomo/
MATOMO_DATABASE_HOST= "{{database_host}}:{{database_port}}"
MATOMO_DATABASE_HOST= "{{ database_host }}:{{ database_port }}"
MATOMO_DATABASE_ADAPTER= "mysql"
MATOMO_DATABASE_USERNAME= "{{database_username}}"
MATOMO_DATABASE_PASSWORD= "{{database_password}}"
MATOMO_DATABASE_DBNAME= "{{database_name}}"
MATOMO_DATABASE_USERNAME= "{{ database_username }}"
MATOMO_DATABASE_PASSWORD= "{{ database_password }}"
MATOMO_DATABASE_DBNAME= "{{ database_name }}"