Removed block from main.yml and moved run_once logic to 01_core.yml

This commit is contained in:
2025-11-28 23:24:04 +01:00
parent 654131ab89
commit 880d0ab1d6
40 changed files with 67 additions and 67 deletions

View File

@@ -47,3 +47,5 @@
- name: "Update all repositories with pkgmgr"
command: "pkgmgr pull --all"
when: MODE_UPDATE | bool
- include_tasks: utils/run_once.yml

View File

@@ -1,5 +1,3 @@
---
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_pkgmgr is not defined

View File

@@ -46,3 +46,5 @@
when:
- setup_mariadb_container_result is defined
- setup_mariadb_container_result.changed
- include_tasks: utils/run_once.yml

View File

@@ -1,6 +1,4 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_svc_db_mariadb is not defined
- name: "Initialize database for '{{ database_name }}'"

View File

@@ -39,3 +39,5 @@
name: "{{ system_service_id | get_service_name(SOFTWARE_NAME, False) ~ escaped_name.stdout }}.service"
state: started
when: MODE_ASSERT | bool
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,2 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_ctl_alm_compose is not defined

View File

@@ -9,3 +9,5 @@
# If the email notifier fails, trigger the Telegram notifier,
# passing the failing unit's name as the instance text.
system_service_tpl_on_failure: "{{ ('sys-ctl-alm-telegram@') | get_service_name(SOFTWARE_NAME, False) }}%n.service"
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,2 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_ctl_alm_email is not defined

View File

@@ -21,3 +21,5 @@
community.general.pacman:
name: curl
state: present
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,2 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_ctl_alm_telegram is not defined

View File

@@ -18,3 +18,5 @@
system_service_on_calendar: "{{ SYS_SCHEDULE_CLEANUP_CERTS }}"
system_service_copy_files: false
system_service_force_linear_sync: false
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,2 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_ctl_cln_certs is not defined

View File

@@ -9,3 +9,5 @@
system_service_on_calendar: "{{SYS_SCHEDULE_HEALTH_BTRFS}}"
system_service_timer_enabled: true
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}"
- include_tasks: utils/run_once.yml

View File

@@ -1,5 +1,3 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_ctl_hlth_btrfs is not defined

View File

@@ -10,3 +10,5 @@
system_service_timer_enabled: true
system_service_tpl_exec_start: "{{ system_service_script_exec }} {{ SIZE_PERCENT_CLEANUP_DISC_SPACE }}"
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }} {{ SYS_SERVICE_CLEANUP_DISC_SPACE }}"
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,2 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_ctl_hlth_disc_space is not defined

View File

@@ -14,3 +14,5 @@
system_service_timer_enabled: true
system_service_on_calendar: "{{ SYS_SCHEDULE_HEALTH_DOCKER_CONTAINER }}"
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }} {{ SYS_SERVICE_REPAIR_DOCKER_SOFT }}"
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,2 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_ctl_hlth_docker_container is not defined

View File

@@ -10,3 +10,5 @@
system_service_timer_enabled: true
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }} {{ SYS_SERVICE_CLEANUP_ANONYMOUS_VOLUMES }}"
system_service_tpl_exec_start: '{{ system_service_script_exec }} "{{ DOCKER_WHITELISTET_ANON_VOLUMES | join(" ") }}"'
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,2 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_ctl_hlth_docker_volumes is not defined

View File

@@ -10,3 +10,5 @@
system_service_timer_enabled: true
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}"
system_service_suppress_flush: true # There are almost allways errors in the journalctl logs so suppression is neccessary to let playbook run
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,2 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_ctl_hlth_journalctl is not defined

View File

@@ -21,3 +21,5 @@
system_service_timer_enabled: true
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}"
system_service_force_linear_sync: false
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,2 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_ctl_mtn_cert_renew is not defined

View File

@@ -19,3 +19,5 @@
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}"
system_service_tpl_exec_start: "/bin/sh -c 'btrfs-auto-balancer 90 10'"
system_service_force_linear_sync: true
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,3 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
when: run_once_sys_ctl_rpr_btrfs_balancer is not defined

View File

@@ -5,3 +5,5 @@
owner: "{{ NGINX.USER }}"
group: "{{ NGINX.USER }}"
mode: '0644'
- include_tasks: utils/run_once.yml

View File

@@ -1,6 +1,4 @@
- block:
- include_tasks: 01_deploy.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_front_inj_desktop is not defined
# --- Build tiny inline initializer (CSP-hashed) ---

View File

@@ -6,3 +6,5 @@
- name: "reset (if enabled)"
include_tasks: 02_reset.yml
when: MODE_RESET | bool
- include_tasks: utils/run_once.yml

View File

@@ -4,9 +4,7 @@
handler_role_name: "sys-daemon"
when: run_once_sys_service is defined
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_service is not defined
- name: "Execute service routines for '{{ system_service_id }}'"

View File

@@ -6,3 +6,5 @@
- name: "Include tasks for 'No-Webroot-ACME-CHALLENGE-METHOD'"
include_tasks: 02_no_webroot.yml
when: CERTBOT_ACME_CHALLENGE_METHOD != 'webroot'
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,2 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_svc_certbot is not defined

View File

@@ -26,3 +26,5 @@
- sys-ctl-hlth-docker-volumes
- sys-ctl-rpr-docker-hard
when: SYS_SVC_DOCKER_LOAD_SERVICES | bool
- include_tasks: utils/run_once.yml

View File

@@ -1,5 +1,3 @@
---
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_sys_svc_docker is not defined

View File

@@ -13,3 +13,5 @@
include_role:
name: update-apt
when: ansible_distribution == "Debian"
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,2 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_update_compose is not defined

View File

@@ -52,3 +52,5 @@
name: user
vars:
user_name: "administrator"
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,2 @@
- block:
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_user_administrator is not defined

View File

@@ -4,3 +4,5 @@
vars:
docker_compose_file_creation_enabled: true
docker_pull_git_repository: false
- include_tasks: utils/run_once.yml

View File

@@ -1,6 +1,3 @@
---
- block:
- name: "Load core functions for '{{ application_id }}'"
include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
- include_tasks: 01_core.yml
when: run_once_web_svc_coturn is not defined