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

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

View File

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

View File

@@ -46,3 +46,5 @@
when: when:
- setup_mariadb_container_result is defined - setup_mariadb_container_result is defined
- setup_mariadb_container_result.changed - 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: 01_core.yml
- include_tasks: utils/run_once.yml
when: run_once_svc_db_mariadb is not defined when: run_once_svc_db_mariadb is not defined
- name: "Initialize database for '{{ database_name }}'" - 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" name: "{{ system_service_id | get_service_name(SOFTWARE_NAME, False) ~ escaped_name.stdout }}.service"
state: started state: started
when: MODE_ASSERT | bool when: MODE_ASSERT | bool
- include_tasks: utils/run_once.yml

View File

@@ -1,4 +1,2 @@
- block: - include_tasks: 01_core.yml
- include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml
when: run_once_sys_ctl_alm_compose is not defined 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, # If the email notifier fails, trigger the Telegram notifier,
# passing the failing unit's name as the instance text. # 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" 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: 01_core.yml
- include_tasks: utils/run_once.yml
when: run_once_sys_ctl_alm_email is not defined when: run_once_sys_ctl_alm_email is not defined

View File

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

View File

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

View File

@@ -17,4 +17,6 @@
system_service_timer_enabled: true system_service_timer_enabled: true
system_service_on_calendar: "{{ SYS_SCHEDULE_CLEANUP_CERTS }}" system_service_on_calendar: "{{ SYS_SCHEDULE_CLEANUP_CERTS }}"
system_service_copy_files: false system_service_copy_files: false
system_service_force_linear_sync: 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: 01_core.yml
- include_tasks: utils/run_once.yml
when: run_once_sys_ctl_cln_certs is not defined when: run_once_sys_ctl_cln_certs is not defined

View File

@@ -8,4 +8,6 @@
vars: vars:
system_service_on_calendar: "{{SYS_SCHEDULE_HEALTH_BTRFS}}" system_service_on_calendar: "{{SYS_SCHEDULE_HEALTH_BTRFS}}"
system_service_timer_enabled: true system_service_timer_enabled: true
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}" 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: 01_core.yml
- include_tasks: utils/run_once.yml
when: run_once_sys_ctl_hlth_btrfs is not defined when: run_once_sys_ctl_hlth_btrfs is not defined

View File

@@ -9,4 +9,6 @@
system_service_on_calendar: "{{ SYS_SCHEDULE_HEALTH_DISC_SPACE }}" system_service_on_calendar: "{{ SYS_SCHEDULE_HEALTH_DISC_SPACE }}"
system_service_timer_enabled: true system_service_timer_enabled: true
system_service_tpl_exec_start: "{{ system_service_script_exec }} {{ SIZE_PERCENT_CLEANUP_DISC_SPACE }}" 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 }}" 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: 01_core.yml
- include_tasks: utils/run_once.yml
when: run_once_sys_ctl_hlth_disc_space is not defined when: run_once_sys_ctl_hlth_disc_space is not defined

View File

@@ -14,3 +14,5 @@
system_service_timer_enabled: true system_service_timer_enabled: true
system_service_on_calendar: "{{ SYS_SCHEDULE_HEALTH_DOCKER_CONTAINER }}" system_service_on_calendar: "{{ SYS_SCHEDULE_HEALTH_DOCKER_CONTAINER }}"
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }} {{ SYS_SERVICE_REPAIR_DOCKER_SOFT }}" 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: 01_core.yml
- include_tasks: utils/run_once.yml
when: run_once_sys_ctl_hlth_docker_container is not defined when: run_once_sys_ctl_hlth_docker_container is not defined

View File

@@ -10,3 +10,5 @@
system_service_timer_enabled: true system_service_timer_enabled: true
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }} {{ SYS_SERVICE_CLEANUP_ANONYMOUS_VOLUMES }}" 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(" ") }}"' 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: 01_core.yml
- include_tasks: utils/run_once.yml
when: run_once_sys_ctl_hlth_docker_volumes is not defined when: run_once_sys_ctl_hlth_docker_volumes is not defined

View File

@@ -10,3 +10,5 @@
system_service_timer_enabled: true system_service_timer_enabled: true
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}" 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 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: 01_core.yml
- include_tasks: utils/run_once.yml
when: run_once_sys_ctl_hlth_journalctl is not defined when: run_once_sys_ctl_hlth_journalctl is not defined

View File

@@ -21,3 +21,5 @@
system_service_timer_enabled: true system_service_timer_enabled: true
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}" system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}"
system_service_force_linear_sync: 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: 01_core.yml
- include_tasks: utils/run_once.yml
when: run_once_sys_ctl_mtn_cert_renew is not defined when: run_once_sys_ctl_mtn_cert_renew is not defined

View File

@@ -18,4 +18,6 @@
system_service_timer_enabled: true system_service_timer_enabled: true
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}" 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_tpl_exec_start: "/bin/sh -c 'btrfs-auto-balancer 90 10'"
system_service_force_linear_sync: true system_service_force_linear_sync: true
- include_tasks: utils/run_once.yml

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -5,4 +5,6 @@
- name: "Include tasks for 'No-Webroot-ACME-CHALLENGE-METHOD'" - name: "Include tasks for 'No-Webroot-ACME-CHALLENGE-METHOD'"
include_tasks: 02_no_webroot.yml include_tasks: 02_no_webroot.yml
when: CERTBOT_ACME_CHALLENGE_METHOD != 'webroot' 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: 01_core.yml
- include_tasks: utils/run_once.yml
when: run_once_sys_svc_certbot is not defined when: run_once_sys_svc_certbot is not defined

View File

@@ -25,4 +25,6 @@
- sys-ctl-hlth-docker-container - sys-ctl-hlth-docker-container
- sys-ctl-hlth-docker-volumes - sys-ctl-hlth-docker-volumes
- sys-ctl-rpr-docker-hard - sys-ctl-rpr-docker-hard
when: SYS_SVC_DOCKER_LOAD_SERVICES | bool 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: 01_core.yml
- include_tasks: utils/run_once.yml
when: run_once_sys_svc_docker is not defined when: run_once_sys_svc_docker is not defined

View File

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

View File

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

View File

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

View File

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

View File

@@ -3,4 +3,6 @@
name: sys-stk-semi-stateless name: sys-stk-semi-stateless
vars: vars:
docker_compose_file_creation_enabled: true docker_compose_file_creation_enabled: true
docker_pull_git_repository: false docker_pull_git_repository: false
- include_tasks: utils/run_once.yml

View File

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