mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 23:08:06 +02:00
sys-ctl: make service file generation deterministic and simplify ignore logic
- Added '| sort' to all service group lists and backup routine lists to ensure deterministic ordering and stable checksums across Ansible runs. - Adjusted systemctl templates to use a single service variable ('SYS_SERVICE_BACKUP_RMT_2_LOC') instead of rejecting dynamic list entries, making the ignore logic simpler and more predictable. - Fixed minor whitespace inconsistencies in Jinja templates to avoid unnecessary changes. This change was made to prevent spurious 'changed' states in Ansible caused by non-deterministic list order and to reduce complexity in service definitions. See discussion: https://chatgpt.com/share/68a74c20-6300-800f-a44e-da43ae2f3dea
This commit is contained in:
@@ -12,13 +12,13 @@ BKP_DOCKER_2_LOC_DB_ENABLED: "{{ database_type | default('') | bool }}"
|
||||
|
||||
# Gather mapped values as lists
|
||||
BKP_DOCKER_2_LOC_DB_ROUTINE: >-
|
||||
{{ applications | find_dock_val_by_bkp_entr('database_routine', 'name') | list }}
|
||||
{{ applications | find_dock_val_by_bkp_entr('database_routine', 'name') | list | sort }}
|
||||
|
||||
BKP_DOCKER_2_LOC_NO_STOP_REQUIRED: >-
|
||||
{{ applications | find_dock_val_by_bkp_entr('no_stop_required', 'image') | list }}
|
||||
{{ applications | find_dock_val_by_bkp_entr('no_stop_required', 'image') | list | sort }}
|
||||
|
||||
BKP_DOCKER_2_LOC_DISABLED: >-
|
||||
{{ applications | find_dock_val_by_bkp_entr('disabled', 'image') | list }}
|
||||
{{ applications | find_dock_val_by_bkp_entr('disabled', 'image') | list | sort }}
|
||||
|
||||
# CLI argument strings (only set if list not empty)
|
||||
BKP_DOCKER_2_LOC_DB_ROUTINE_CLI: >-
|
||||
@@ -45,4 +45,4 @@ BKP_DOCKER_2_LOC_CLI_ARGS_LIST:
|
||||
BKP_DOCKER_2_LOC_EXEC: >-
|
||||
/usr/bin/python {{ backup_docker_to_local_folder }}backup-docker-to-local.py
|
||||
--compose-dir {{ PATH_DOCKER_COMPOSE_INSTANCES }}
|
||||
{{ BKP_DOCKER_2_LOC_CLI_ARGS_LIST | select('string') | join(' ') }}
|
||||
{{ BKP_DOCKER_2_LOC_CLI_ARGS_LIST | select('string') | join(' ') }}
|
||||
|
Reference in New Issue
Block a user