Split host setup into explicit entity actions

This commit is contained in:
deytenit committed 2026-11-08 12:39:49 +03:00
1 parent a297e7c71e
commit ba9ef92051
51 files changed
+1023 -275

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
# actions/config/cron.py
"""Port of config/cron — install crontab from configs/cron/crontab."""
import os
from engine.descriptor import Meta, Flag
METADATA = Meta(summary="Install the node crontab from configs/cron/crontab.",
args=[Flag("--dry-run", "Render + preview; do not install.")])
def run(ctx, args):
crontab = os.path.join(ctx.paths.configs, "cron", "crontab")
if not os.path.isfile(crontab):
ctx.log.error(f"Crontab file not found: {crontab}"); raise SystemExit(1)
text = ctx.tpl.render(crontab, ctx.vars())
ctx.host.install_crontab(text, dry_run=args.dry_run)