From 838a8fc7a12012628877a8af6b78d946ed3c2fce Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 19 Aug 2025 21:50:55 +0200 Subject: [PATCH] Solved svc-opt-ssd-hdd path bug --- roles/svc-opt-ssd-hdd/schema/main.yml | 4 ++-- roles/svc-opt-ssd-hdd/tasks/main.yml | 5 ++++- roles/svc-opt-ssd-hdd/templates/systemctl.service.j2 | 8 -------- roles/svc-opt-ssd-hdd/vars/main.yml | 2 +- roles/sys-service/templates/systemctl.service.j2 | 3 +++ roles/sys-service/vars/main.yml | 9 +++++---- roles/web-app-mig/config/main.yml | 12 ++++++------ 7 files changed, 21 insertions(+), 22 deletions(-) delete mode 100644 roles/svc-opt-ssd-hdd/templates/systemctl.service.j2 diff --git a/roles/svc-opt-ssd-hdd/schema/main.yml b/roles/svc-opt-ssd-hdd/schema/main.yml index b815e7b2..844fe953 100644 --- a/roles/svc-opt-ssd-hdd/schema/main.yml +++ b/roles/svc-opt-ssd-hdd/schema/main.yml @@ -4,8 +4,8 @@ credentials: algorithm: "bcrypt" validation: "^\\$2[aby]\\$.{56}$" -OPT_DRIVE_RAPID_STORAGE_PATH: +rapid_storage: description: "Mount path of the servers SSD" -OPT_DRIVE_MASS_STORAGE_PATH: +mass_storage: description: "Mount path of the servers HDD" \ No newline at end of file diff --git a/roles/svc-opt-ssd-hdd/tasks/main.yml b/roles/svc-opt-ssd-hdd/tasks/main.yml index 85b1e4b6..b2b2a9d5 100644 --- a/roles/svc-opt-ssd-hdd/tasks/main.yml +++ b/roles/svc-opt-ssd-hdd/tasks/main.yml @@ -1,2 +1,5 @@ - include_role: - name: sys-service \ No newline at end of file + name: sys-service + vars: + system_service_tpl_exec_start_pre: '/usr/bin/python {{ PATH_SYSTEM_LOCK_SCRIPT }} {{ SYS_SERVICE_GROUP_MANIPULATION | join(" ") }} --ignore {{ SYS_SERVICE_OPTIMIZE_DRIVE }} {{ SYS_SERVICE_BACKUP_RMT_2_LOC }} --timeout "{{ SYS_TIMEOUT_STORAGE_OPTIMIZER }}"' + system_service_tpl_exec_start: '{{ system_service_script_exec }} --mass-storage-path {{ OPT_DRIVE_MASS_STORAGE_PATH }} --rapid-storage-path {{ OPT_DRIVE_RAPID_STORAGE_PATH }}' \ No newline at end of file diff --git a/roles/svc-opt-ssd-hdd/templates/systemctl.service.j2 b/roles/svc-opt-ssd-hdd/templates/systemctl.service.j2 deleted file mode 100644 index 6e1f89a7..00000000 --- a/roles/svc-opt-ssd-hdd/templates/systemctl.service.j2 +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Optimize storage paths -OnFailure={{ SYS_SERVICE_ON_FAILURE_COMPOSE }} - -[Service] -Type=oneshot -ExecStartPre=/usr/bin/python {{ PATH_SYSTEM_LOCK_SCRIPT }} {{ SYS_SERVICE_GROUP_MANIPULATION | join(' ') }} --ignore {{ SYS_SERVICE_OPTIMIZE_DRIVE }} {{ SYS_SERVICE_BACKUP_RMT_2_LOC }} --timeout "{{ SYS_TIMEOUT_STORAGE_OPTIMIZER }}" -ExecStart={{ system_service_script_exec }} --mass-storage-path {{ OPT_DRIVE_MASS_STORAGE_PATH }} \ No newline at end of file diff --git a/roles/svc-opt-ssd-hdd/vars/main.yml b/roles/svc-opt-ssd-hdd/vars/main.yml index 98f447ef..8001cd6f 100644 --- a/roles/svc-opt-ssd-hdd/vars/main.yml +++ b/roles/svc-opt-ssd-hdd/vars/main.yml @@ -1,4 +1,4 @@ application_id: svc-opt-ssd-hdd -system_service_id: "{{ application_id }}" +system_service_id: "{{ application_id }}" OPT_DRIVE_RAPID_STORAGE_PATH: "{{ applications | get_app_conf(application_id, 'volumes.rapid_storage') }}" OPT_DRIVE_MASS_STORAGE_PATH: "{{ applications | get_app_conf(application_id, 'volumes.mass_storage') }}" diff --git a/roles/sys-service/templates/systemctl.service.j2 b/roles/sys-service/templates/systemctl.service.j2 index 26d0d150..2b633a5b 100644 --- a/roles/sys-service/templates/systemctl.service.j2 +++ b/roles/sys-service/templates/systemctl.service.j2 @@ -6,6 +6,9 @@ OnFailure={{ system_service_tpl_on_failure }} [Service] Type={{ system_service_tpl_type }} +{% if system_service_tpl_exec_start_pre |length > 0 %} +ExecStartPre={{ system_service_tpl_exec_start_pre }} +{% endif %} ExecStart={{ system_service_tpl_exec_start }} {% if system_service_tpl_runtime |length > 0 %} RuntimeMaxSec={{ system_service_tpl_runtime }} diff --git a/roles/sys-service/vars/main.yml b/roles/sys-service/vars/main.yml index 5909e887..2c64332c 100644 --- a/roles/sys-service/vars/main.yml +++ b/roles/sys-service/vars/main.yml @@ -17,7 +17,8 @@ system_service_script_inter: "/bin/{{ 'bash' if system_service_script_type == system_service_script_exec: "{{ system_service_script_inter }} {{ system_service_id | get_service_script_path( system_service_script_type ) }}" # Service template -system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}" -system_service_tpl_type: "oneshot" -system_service_tpl_exec_start: "{{ system_service_script_exec }}" -system_service_tpl_runtime: "{{ SYS_SERVICE_DEFAULT_RUNTIME }}" \ No newline at end of file +system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}" +system_service_tpl_type: "oneshot" +system_service_tpl_exec_start: "{{ system_service_script_exec }}" +system_service_tpl_runtime: "{{ SYS_SERVICE_DEFAULT_RUNTIME }}" +system_service_tpl_exec_start_pre: "" \ No newline at end of file diff --git a/roles/web-app-mig/config/main.yml b/roles/web-app-mig/config/main.yml index a9425e88..c54ce980 100644 --- a/roles/web-app-mig/config/main.yml +++ b/roles/web-app-mig/config/main.yml @@ -1,14 +1,14 @@ docker: services: redis: - enabled: false # No redis needed + enabled: false # No redis needed database: - enabled: false # No database needed + enabled: false # No database needed features: - matomo: true # activate tracking - css: true # use custom infinito stile - desktop: true # Enable in port-ui - logout: false + matomo: true # activate tracking + css: true # use custom infinito stile + desktop: true # Enable in port-ui + logout: false server: csp: whitelist: