apply

command
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: AGPL-3.0 Imports: 32 Imported by: 0

README

apply

Write/action MCP server: runs allowlisted Ansible playbooks and arbitrary SSH commands against cluster nodes, gated by a blocking ntfy push-notification approval. Pairs with inspect (read-only) — same jumpbox, same inventory, different privilege posture.

task up      # bundled battery stack: mknote + ntfy (apply's approval backend)
task apply   # go run ./cmd/apply

NTFY_BASE_URL/NTFY_TOPIC/NTFY_TOKEN/CALLBACK_BASE_URL are required — apply won't start without an approval backend configured (the bundled ntfy container from task up is the batteries-included default; see .env.local.example).

The playbook-directory contract

run_playbook never takes an arbitrary path — only a name, resolved live off disk (no rebuild needed to pick up a git pull) against two directories under CLUSTER_REPO_DIR:

  • ansible/playbooks/safe/ — single approval tap.
  • ansible/playbooks/manual-only/ — approval asked twice (double-confirm).

This directory placement is the trust tier — there's no separate allowlist file. examples/cluster-repo/ ships two harmless safe/ plays (uptime.yml, disk-free.yml) and one manual-only/ play that demonstrates the tier without doing anything (see its own comment). Point CLUSTER_REPO_DIR at your own checkout to replace it.

CALLBACK_BASE_URL must be phone-reachable

The ntfy Approve/Deny buttons are HTTP links baked in at request time — whatever taps them (your phone, in ntfy's app) needs a working path to CALLBACK_BASE_URL, not just apply needing a path to NTFY_BASE_URL. For the bundled local demo this doesn't matter (everything's on localhost); for a real deployment, this is usually the part that needs a tunnel/VPN/ public endpoint, not the ntfy server itself. See API.md for the full /approval/{id}/{decision} contract.

DSM = two accounts, one URL

Same DSM_BASE_URL as inspect, but dsm_admin_query here needs an admin-group account (DSM_ADMIN_USER/DSM_ADMIN_PASSWORD) — inspect's dsm_query deliberately uses a separate least-privilege account that structurally can't reach these Control-Panel-level config APIs (DSM error 105). Don't collapse the two to one account.

See API.md for the full approval-callback HTTP contract.

Documentation

Overview

apply is an MCP server that runs allowlisted Ansible playbooks against cluster nodes, gated by a blocking ntfy push- notification approval. It's meant to run on a jumpbox alongside inspect, deliberately outside the cluster's k8s ingress, so it stays usable during the apiserver/etcd brownouts that are the whole reason it exists.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址