mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-16 15:26:05 +02:00
Refactor alarm compose service and systemctl templates
- Fixed bug where not both alarm services (email + telegram) were triggered. - Removed direct OnFailure references for email and telegram, now handled by unified compose service. - Introduced 01_core.yml in sys-ctl-alm-compose to structure role execution (subservices → core service → test run). - Added configurable variables SYSTEMCTL_ALARM_COMPOSER_SUBSERVICES and SYSTEMCTL_ALARM_COMPOSER_DUMMY_MESSAGE. - Replaced dedicated @.service template with generic systemctl template using systemctl_tpl_* variables for flexibility. - Updated script.sh.j2 to collect exit codes and print clear errors. - Fixed typos and streamlined vars in sys-systemctl. See conversation: https://chatgpt.com/share/68a46172-7c3c-800f-a69c-0cb9edd6839f
This commit is contained in:
@@ -7,11 +7,16 @@ systemctl_script_dir: "{{ [ PATH_SYSTEMCTL_SCRIPTS, systemctl_id ] | path_jo
|
||||
|
||||
## Settings
|
||||
systemctl_copy_files: true # When set to false file copying will be skipped
|
||||
systemctl_timer_enabled: false # When set to true timmer will be loaded
|
||||
systemctl_timer_enabled: false # When set to true timer will be loaded
|
||||
systemctl_state: "{{ SYS_SERVICE_DEFAULT_STATE }}"
|
||||
|
||||
# Dynamic Loaded ( Just available when dependencies are loaded )
|
||||
systemctl_script_base: "{{ systemctl_script_src | basename | regex_replace('\\.j2$', '') }}"
|
||||
systemctl_script_type: "{{ systemctl_script_base | filetype }}"
|
||||
systemctl_script_inter: "/bin/{{ 'bash' if systemctl_script_type == 'sh' else 'python3'}}"
|
||||
systemctl_script_exec: "{{ systemctl_script_inter }} {{ systemctl_id | get_service_script_path( systemctl_script_type ) }}"
|
||||
systemctl_script_exec: "{{ systemctl_script_inter }} {{ systemctl_id | get_service_script_path( systemctl_script_type ) }}"
|
||||
|
||||
# Service template
|
||||
systemctl_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}"
|
||||
systemctl_tpl_type: "oneshot"
|
||||
systemctl_tpl_exec_start: "{{ systemctl_script_exec }}"
|
Reference in New Issue
Block a user