Skip to main content
← Back to list
01Issue
FeatureOpenSwamp CLI
AssigneesNone

Relationships

#487 Support dynamic host discovery from external sources

Opened by bixu · 5/29/2026

Problem

The @swamp/ssh model requires a static host list in globalArguments.hosts. When infrastructure is managed by an external provisioner (e.g. Terraform, Pulumi, or a cloud API), nodes are regularly created, replaced, or destroyed — and their IPs change each time. The SSH model's host list becomes stale immediately after any infrastructure change, requiring manual edits to keep it in sync.

This is particularly painful during iterative infrastructure development where nodes are frequently rebuilt. Every replacement cycle means updating names, IPs, and tags in the model YAML by hand.

Proposed solution

Add a mechanism for @swamp/ssh to discover hosts dynamically at method execution time, rather than requiring a static list. Possible approaches:

  1. hostsFrom field — reference another model's data output as the host source. For example, a cloud provider model that produces server inventory could feed the SSH model's host list:

    globalArguments:
      hostsFrom:
        model: my-server-inventory
        dataName: servers
        mapping:
          name: attributes.name
          address: attributes.private_ip
          tags: attributes.labels
  2. hostCommand — run a shell command or script at execution time that emits a JSON host list on stdout.

  3. sync method — a built-in method that pulls hosts from a configured source and updates the model's host list in place.

Option 1 (data-driven discovery via CEL/model reference) feels most aligned with swamp's model-wiring philosophy. It keeps the SSH model declarative while delegating inventory to the system that actually knows the infrastructure state.

Alternatives considered

  • Manual updates: current approach; error-prone and tedious during active development.
  • Wrapper workflow: a workflow that runs a cloud inventory model first, then programmatically updates the SSH model YAML before running SSH commands. Works but is a workaround, not a solution — the SSH model still has a stale static list between workflow runs.

Upstream repository: https://github.com/systeminit/swamp-extensions

Environment

  • Extension: @swamp/ssh@2026.05.25.1
  • swamp: 20260527.235818.0-sha.ed572875
  • OS: darwin (aarch64)
  • Deno: 2.7.14+19bd3d8
  • Shell: /bin/zsh
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

5/29/2026, 2:23:58 PM

No activity in this phase yet.

03Sludge Pulse
Editable. Press Enter to edit.

bixu commented 5/29/2026, 2:26:44 PM

Specific use-case was a distributed debugging loop against a cloud provider where we are building out a new k3s thing.

Sign in to post a ripple.