Skip to content

mooncake apply

Apply a playbook or saved plan. Use --dry-run to preview without changes.

Flags

Flag Type Default Description
--config / -c string - Path to configuration file (default: ./mooncake.yml or ./mooncake/main.yml)
--vars / -v []string - Path to a variables file. Repeat to layer multiple files; later wins on key collision.
--log-level / -l string info Log level (debug, info, error)
--sudo-pass / -s string - Sudo password for steps with become: true (requires --insecure-sudo-pass)
--ask-become-pass / -K bool false Prompt for sudo password interactively (recommended)
--sudo-pass-file string - Read sudo password from file (must have 0600 permissions)
--insecure-sudo-pass bool false Allow --sudo-pass flag (WARNING: password visible in shell history)
--tags / -t string - Filter steps by tags (comma-separated)
--skip-tags string - Exclude steps whose tags appear in this list (comma-separated). Composes with --tags via AND.
--dry-run / -n bool false Preview changes without executing (sugar for mooncake plan)
--tui bool false Use the animated TUI subscriber (default: raw console output)
--output-format / -format string text Output format: text or json (json requires not using --tui)
--artifacts-dir string - Directory to store run artifacts (e.g., .mooncake)
--capture-full-output bool false Capture full stdout/stderr to artifacts (requires --artifacts-dir)
--max-output-bytes int 1048576 Max bytes of step output captured to the artifacts bundle (stdout.log/stderr.log)
--max-output-lines int 1000 Max lines of step output captured to the artifacts bundle (stdout.log/stderr.log)
--from-plan string - Apply from saved plan file (JSON or YAML)
--facts-json string - Path to write collected facts as JSON
--host string - Override the auto-detected hostname for overlay lookup (vars/by-host/.yml). Also honors $MOONCAKE_HOST. An explicit name whose by-host file is missing is an error.
--overlays string on Local overlay auto-load: 'on' (default) loads vars/common.yml and vars/by-host/.yml; 'off' disables.
--allow-stale bool false Apply a saved plan even if host facts mismatch or input files have changed since plan time
--max-plan-age duration - Refuse to apply a saved plan older than this duration (e.g. 1h). Default: no limit.
--no-stream-output bool false Hide captured stdout/stderr from steps; show only lifecycle markers. Has no effect with --output-format json (event stream is always full).