mooncake task¶
Run a named task from tasks.yml (or tasks: in mooncake.yml)
Description¶
Without an argument, lists every task defined in the discovered config with its description. With a name, runs that task through the same planner + executor that mooncake apply uses — only the step list and the var overlay differ.
Discovery: ./tasks.yml is preferred, otherwise the apply-config search path is used (must contain a tasks: block). When both a tasks file and a mooncake.yml with tasks: exist, the tasks file wins and a warning is printed.
Variable precedence (highest first): --vars files, task-level vars:, file-level vars:.
Flags¶
| Flag | Type | Default | Description |
|---|---|---|---|
--config / -c |
string | - | Path to tasks file (default: ./tasks.yml, then ./mooncake.yml) |
--vars / -v |
[]string | - | Path to a variables file. Repeat to layer; later wins on key collision and overrides task-level vars. |
--log-level / -l |
string | info |
Log level (debug, info, error). Step stdout/stderr streams regardless; debug adds internal traces. |
--plan / -p |
bool | false | Print the task's plan without executing it (paired with --format, --diff, --show-origins) |
--format / -f |
string | text |
Plan output format (with --plan): text, json, or yaml |
--diff / -d |
bool | false | With --plan: show unified diff for file steps that would change content |
--show-origins |
bool | false | With --plan: include file:line:col for each step |
--tags / -t |
string | - | Filter the task's steps by tags (comma-separated) |
--skip-tags |
string | - | Exclude steps whose tags appear in this list (comma-separated). Composes with --tags via AND. |
--sudo-pass-file |
string | - | Read sudo password from file (must have 0600 permissions) |
--sudo-pass / -s |
string | - | Sudo password (requires --insecure-sudo-pass) |
--ask-become-pass / -K |
bool | false | Prompt for sudo password interactively |
--insecure-sudo-pass |
bool | false | Allow --sudo-pass flag (WARNING: visible in shell history) |