repo_script
Execute scripts from a local repo checkout on fleet hosts via SSH, showing a dry-run plan before applying changes.
Instructions
Run one of your own fleet scripts from a local repo checkout (MIA_REPOS, e.g. ops=~/src/ops-scripts) on hosts: deploy/migrate-blacklist.sh, lock-mgmt-ports-apply.sh, install-beszel.sh … The script (plus files listed in with, same relative paths) is sent over ssh, run as root from a temp dir, then removed. Exactly the checked-out version runs: the plan shows the commit, uncommitted changes and a hash of the files. Secrets go by env var name (envFrom): the value is read from mia's own environment and never shown.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | non-secret variables | |
| args | No | ||
| repo | No | repo name from MIA_REPOS | ops |
| with | No | other repo files the script reads (relative paths are kept) | |
| apply | No | false (default) = dry run: show what will happen on which hosts and a planHash. true = run it; needs planHash | |
| batch | No | hosts at a time (rolling). Default depends on the action: 1 for disruptive ones | |
| script | Yes | path inside the repo, e.g. deploy/migrate-blacklist.sh | |
| target | Yes | hosts: all | <host> | <glob nl-*> | <group> | role:<edge|remnanode|panel|docker> | tag:<tag>; comma-separated, !x excludes | |
| envFrom | No | names of variables to pass from mia's environment (secrets) | |
| planHash | No | planHash from the dry run of the very same call, good for one apply; refused if targets or their state changed since | |
| installTo | No | install the script at this path first (e.g. /usr/local/bin/ufw-blacklist.sh, which cron re-runs), then run that copy; the previous copy is kept as .bak-<time> | |
| timeoutSec | No | ||
| installOnly | No | with installTo: only install the new copy (bash -n checked), do not run it — cron picks it up | |
| continueOnError | No | keep going after a host fails (default: stop the rollout at the first failure) | |
| skipUnreachable | No | skip hosts that do not answer over ssh instead of refusing the whole plan (they show as skipped) |