{"id":"caddy-rule-idempotent-action","text":"The Caddy rule's action phase is idempotent: `copy` overwrites the Caddyfile, `firewalld` with `state=\"enabled\"` is a no-op if already enabled, and `service` with `state=\"started\"` is a no-op if already running.","truth_value":"IN","source":"entries/2026/05/11/deployments-catbeez-rules-ensure_arcade_caddy.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{"example":"# From cloudflare-stargate/rules/ensure_stargate_caddy.py pattern\n# Observe checks if Caddy is running and config is correct\n# Action writes config and restarts only if condition detected drift\nawait ftl[\"stargate\"].copy(content=caddyfile, dest=\"/etc/caddy/Caddyfile\", mode=\"0644\")\nawait ftl[\"stargate\"].service(name=\"caddy\", state=\"restarted\")"},"explanation":{"steps":[{"node":"caddy-rule-idempotent-action","truth_value":"IN","reason":"premise"}]}}