mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
A templated script is opaque to every tool that reads shell. shellcheck parses Jinja as syntax errors, the repository's own .sh guards skip the file because it is not a .sh, and nothing can execute it to test it: what runs on the host never exists in the repository, so a defect in the rendered half is found by deploying it. The lint reports any *.sh.j2 under roles and points at the static slot sys-service already resolves, files/shell/script.sh, with the values passed as ExecStart arguments or Environment entries the way this repository's python scripts already take them. None of the seven templates present meets the bar the marker is for, which is a script whose shape is generated rather than its values. Each is grandfathered with a marker naming what it interpolates, because converting a deployed script to argv changes what runs on the host. The guard exists to stop the next one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
19 lines
482 B
Django/Jinja
19 lines
482 B
Django/Jinja
#!/bin/bash
|
|
{# nocheck: shell-template grandfathered, values only: the provider list and two paths #}
|
|
# Pulls the remote backups from multiple hosts
|
|
|
|
hosts="{{ DOCKER_BACKUP_REMOTE_2_LOCAL_BACKUP_PROVIDERS | join(' ') }}"
|
|
errors=0
|
|
|
|
for host in $hosts; do
|
|
if ! python3 {{ DOCKER_BACKUP_REMOTE_2_LOCAL_SCRIPT }} "$host" --folder "{{ DIR_BACKUPS }}"; then
|
|
echo "FAILURE: pull from ${host} failed" >&2
|
|
((errors+=1))
|
|
fi
|
|
done
|
|
|
|
if [ "$errors" -gt 0 ]; then
|
|
exit 1
|
|
fi
|
|
exit 0
|