diff --git a/CLAUDE.md b/CLAUDE.md index 7ea0a8e..809fdb7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -194,6 +194,51 @@ node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes node_filesystem_avail_bytes{mountpoint="/"} ``` +### Deploying to Test Hosts + +The **homelab-deploy** MCP server enables remote deployments to test-tier hosts via NATS messaging. + +**Available Tools:** + +- `deploy` - Deploy NixOS configuration to test-tier hosts +- `list_hosts` - List available deployment targets + +**Deploy Parameters:** + +- `hostname` - Target a specific host (e.g., `vaulttest01`) +- `role` - Deploy to all hosts with a specific role (e.g., `vault`) +- `all` - Deploy to all test-tier hosts +- `action` - nixos-rebuild action: `switch` (default), `boot`, `test`, `dry-activate` +- `branch` - Git branch or commit to deploy (default: `master`) + +**Examples:** + +``` +# List available hosts +list_hosts() + +# Deploy to a specific host +deploy(hostname="vaulttest01", action="switch") + +# Dry-run deployment +deploy(hostname="vaulttest01", action="dry-activate") + +# Deploy to all hosts with a role +deploy(role="vault", action="switch") +``` + +**Note:** Only test-tier hosts with `homelab.deploy.enable = true` and the listener service running will respond to deployments. + +**Verifying Deployments:** + +After deploying, use the `nixos_flake_info` metric from nixos-exporter to verify the host is running the expected revision: + +```promql +nixos_flake_info{instance=~"vaulttest01.*"} +``` + +The `current_rev` label contains the git commit hash of the deployed flake configuration. + ## Architecture ### Directory Structure