From a5941763ff3bda2ae1369d6d2b710be857745174 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 18 Aug 2025 01:05:01 +0200 Subject: [PATCH] refactor: normalize Jinja2 spacing in volume paths and add async support in backup task - Standardized spacing in {{ docker_compose.directories.volumes }} across multiple roles - Added async and poll support to sys-bkp-docker-2-loc database seeding and file permission tasks - Moved Installation.md for web-app-matrix into docs/ for better structure --- roles/svc-db-openldap/vars/main.yml | 2 +- .../sys-bkp-docker-2-loc/tasks/04_seed-database-to-backup.yml | 4 ++++ roles/web-app-matrix/{ => docs}/Installation.md | 0 roles/web-app-nextcloud/templates/docker-compose.yml.j2 | 2 +- roles/web-app-oauth2-proxy/templates/container.yml.j2 | 2 +- roles/web-app-openproject/vars/main.yml | 4 ++-- roles/web-app-pgadmin/vars/db_config.yml | 4 ++-- 7 files changed, 11 insertions(+), 7 deletions(-) rename roles/web-app-matrix/{ => docs}/Installation.md (100%) diff --git a/roles/svc-db-openldap/vars/main.yml b/roles/svc-db-openldap/vars/main.yml index 7a5d09c1..7a97b77c 100644 --- a/roles/svc-db-openldap/vars/main.yml +++ b/roles/svc-db-openldap/vars/main.yml @@ -8,7 +8,7 @@ openldap_bind_dn: "{{ ldap.dn.administrator.configuration }}" openldap_bind_pw: "{{ applications | get_app_conf(application_id, 'credentials.administrator_password', True) }}" # LDIF Variables -openldap_ldif_host_path: "{{docker_compose.directories.volumes}}ldif/" +openldap_ldif_host_path: "{{ docker_compose.directories.volumes }}ldif/" openldap_ldif_docker_path: "/tmp/ldif/" openldap_ldif_types: - configuration diff --git a/roles/sys-bkp-docker-2-loc/tasks/04_seed-database-to-backup.yml b/roles/sys-bkp-docker-2-loc/tasks/04_seed-database-to-backup.yml index 554282a9..70aac456 100644 --- a/roles/sys-bkp-docker-2-loc/tasks/04_seed-database-to-backup.yml +++ b/roles/sys-bkp-docker-2-loc/tasks/04_seed-database-to-backup.yml @@ -43,6 +43,8 @@ - database_username is defined - database_password is defined no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}" + async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}" + poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}" - name: Set file permissions for databases.csv to be readable, writable, and executable by root only ansible.builtin.file: @@ -57,6 +59,8 @@ database_password is defined) and run_once_sys_bkp_docker_2_loc_file_permission is not defined register: file_permission_result + async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}" + poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}" - name: run the backup_docker_to_local_file_permission tasks once set_fact: diff --git a/roles/web-app-matrix/Installation.md b/roles/web-app-matrix/docs/Installation.md similarity index 100% rename from roles/web-app-matrix/Installation.md rename to roles/web-app-matrix/docs/Installation.md diff --git a/roles/web-app-nextcloud/templates/docker-compose.yml.j2 b/roles/web-app-nextcloud/templates/docker-compose.yml.j2 index 6dbb651b..d11cee41 100644 --- a/roles/web-app-nextcloud/templates/docker-compose.yml.j2 +++ b/roles/web-app-nextcloud/templates/docker-compose.yml.j2 @@ -41,7 +41,7 @@ ports: - "127.0.0.1:{{ports.localhost.http[application_id]}}:{{ container_port }}" volumes: - - "{{docker_compose.directories.volumes}}nginx.conf:/etc/nginx/nginx.conf:ro" + - "{{ docker_compose.directories.volumes }}nginx.conf:/etc/nginx/nginx.conf:ro" volumes_from: - application diff --git a/roles/web-app-oauth2-proxy/templates/container.yml.j2 b/roles/web-app-oauth2-proxy/templates/container.yml.j2 index fe1ed952..9cb13e55 100644 --- a/roles/web-app-oauth2-proxy/templates/container.yml.j2 +++ b/roles/web-app-oauth2-proxy/templates/container.yml.j2 @@ -7,5 +7,5 @@ ports: - {{ports.localhost.oauth2_proxy[application_id]}}:4180/tcp volumes: - - "{{docker_compose.directories.volumes}}{{applications | get_app_conf('web-app-oauth2-proxy','configuration_file')}}:/oauth2-proxy.cfg" + - "{{ docker_compose.directories.volumes }}{{applications | get_app_conf('web-app-oauth2-proxy','configuration_file')}}:/oauth2-proxy.cfg" {% endif %} \ No newline at end of file diff --git a/roles/web-app-openproject/vars/main.yml b/roles/web-app-openproject/vars/main.yml index a3243973..e436c7bf 100644 --- a/roles/web-app-openproject/vars/main.yml +++ b/roles/web-app-openproject/vars/main.yml @@ -29,12 +29,12 @@ openproject_cache_version: "{{ applications }}" -openproject_plugins_folder: "{{docker_compose.directories.volumes}}plugins/" +openproject_plugins_folder: "{{ docker_compose.directories.volumes }}plugins/" openproject_custom_image: "custom_openproject" # The following volume doesn't have a practcical function. It just exist to prevent the creation of unnecessary anonymous volumes -openproject_dummy_volume: "{{docker_compose.directories.volumes}}dummy_volume" +openproject_dummy_volume: "{{ docker_compose.directories.volumes }}dummy_volume" openproject_rails_settings: email_delivery_method: "smtp" diff --git a/roles/web-app-pgadmin/vars/db_config.yml b/roles/web-app-pgadmin/vars/db_config.yml index 4f4352b8..e71ee4ac 100644 --- a/roles/web-app-pgadmin/vars/db_config.yml +++ b/roles/web-app-pgadmin/vars/db_config.yml @@ -1,6 +1,6 @@ -pgadmin_host_server_file: "{{docker_compose.directories.volumes}}servers.json" +pgadmin_host_server_file: "{{ docker_compose.directories.volumes }}servers.json" pgadmin_docker_server_file: "/pgadmin4/servers.json" -pgadmin_host_password_file: "{{docker_compose.directories.volumes}}.pgpass" +pgadmin_host_password_file: "{{ docker_compose.directories.volumes }}.pgpass" pgadmin_docker_password_file: "/pgpass" pgadmin_servers: