Files
computer-playbook/roles/sys-service/tasks/04_files.yml
Kevin Veen-Birkenbach e53abbec3b Refactor alarm composer and sys-service handling:
- Introduce dynamic SYSTEMCTL_ALARM_COMPOSER_SUBSERVICES based on Mailu token and MODE_RESET
- Prevent inclusion of sys-ctl-alm-email when disabled
- Add system_service_is_template flag to avoid state-setting on template services
- Update notifications to reload daemon for @ template units
- Align msmtp execution conditions

See: https://chatgpt.com/share/692c7a71-afcc-800f-8aba-6800a042ce3b
2025-11-30 18:10:30 +01:00

26 lines
1.0 KiB
YAML

- name: "create {{ system_service_script_dir }}"
file:
path: "{{ system_service_script_dir }}"
state: directory
mode: "0755"
- name: "template or copy script"
block:
- name: "render template"
template:
src: "{{ system_service_script_src }}"
dest: "{{ [system_service_script_dir, (system_service_script_src | basename | regex_replace('\\.j2$', ''))] | path_join }}"
mode: "0755"
notify: "{{ 'reload system daemon' if system_service_is_template | bool else 'refresh systemctl service' }}"
when: system_service_script_src.endswith('.j2')
- name: "copy raw file"
copy:
src: "{{ system_service_script_src }}"
dest: "{{ [system_service_script_dir, (system_service_script_src | basename)] | path_join }}"
mode: "0755"
when: not system_service_script_src.endswith('.j2')
notify: "{{ 'reload system daemon' if system_service_is_template | bool else 'refresh systemctl service' }}"
when: system_service_copy_files | bool