Skip to content

feat: add support for bare-metal provisioning - #16

Merged
cafkafk merged 8 commits into
mainfrom
BareMetal_provisioner
Apr 26, 2026
Merged

cafkafk merged 8 commits into
mainfrom
BareMetal_provisioner

Conversation

@cafkafk

@cafkafk cafkafk commented Apr 25, 2026

Copy link
Copy Markdown
Owner
  • Introduce BareMetal provisioner type to support nodes without
    infrastructure-as-code providers, allowing manual IP resolution via
    CLI or interactive prompt.
  • Implement forceHwLink support for SSH hosts, enabling connections
    to bypass overlay networks (like Tailscale) by binding to physical
    interfaces via socat.
  • Refactor hardware link binding logic into a shared method on the Ssh
    struct to reuse implementation between initrd and standard deployment
    SSH connections.
  • Add --ip flag to provision command to skip interactive IP prompts
    for bare-metal hosts.

cafkafk added 8 commits April 25, 2026 22:01
…binding

- Introduce `BareMetal` provisioner type to support nodes without
  infrastructure-as-code providers, allowing manual IP resolution via
  CLI or interactive prompt.
- Implement `forceHwLink` support for `SSH` hosts, enabling connections
  to bypass overlay networks (like Tailscale) by binding to physical
  interfaces via `socat`.
- Refactor hardware link binding logic into a shared method on the `Ssh`
  struct to reuse implementation between initrd and standard deployment
  SSH connections.
- Add `--ip` flag to `provision` command to skip interactive IP prompts
  for bare-metal hosts.
Introduces an `--initial-password` flag to the `provision` command to
support bare-metal hosts requiring password authentication before SSH
keys are configured.

The implementation:
- Passes the password to `nixos-anywhere` via the `--env-password` flag
  using `sshpass`.
- Updates `wait_for_connectivity` to use `sshpass` for initial handshake
  verification.
- Forces `PreferredAuthentications=password` and `IdentitiesOnly=yes`
  when a password is provided to ensure successful authentication and
  prevent key-based auth failures.
Include sshpass and socat in the development shell and wrap the
navi binary with these utilities to support enhanced networking and
authentication tasks when using nixos-anywhere.
Update the network interface detection logic to ignore interfaces
lacking the `LOWER_UP` flag. This prevents the selection of interfaces
that are administratively up but lack a physical carrier (e.g.,
disconnected wifi), ensuring only active links are considered.
Adds a `tracing::debug` log statement to capture the SSH command
execution details, aiding in troubleshooting connectivity issues.
Adds `-o BatchMode=no` to the SSH command when waiting for connectivity.
This prevents the command from failing immediately if the connection
cannot be established with the provided credentials before the timeout
occurs.
When using password authentication via `sshpass`, certain standard
SSH flags interfere with the process. This commit adds logic to filter
out `BatchMode=yes` (which prevents password prompts) and `-T` (which
suppresses TTY allocation) from the `ssh_opts` when `initial_password`
is provided, ensuring reliable connectivity testing.
…Mode

Adjusts SSH option handling to remove `BatchMode=yes` when an initial
password is provided. This ensures that SSH can prompt for and accept
passwords via `sshpass` rather than failing due to non-interactive
constraints. The filtering logic has been unified to apply cleanly to
both the connectivity check and the deployment process.
@cafkafk

cafkafk commented Apr 25, 2026 •

Copy link
Copy Markdown
Owner Author

Works, but I'll test it a bit more before merge.

@cafkafk cafkafk changed the title feat: add support for bare-metal provisioning and physical interface binding feat: add support for bare-metal provisioning Apr 25, 2026
@cafkafk cafkafk mentioned this pull request Apr 26, 2026

@cafkafk cafkafk left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@cafkafk
cafkafk merged commit 7aa9d08 into main Apr 26, 2026
@cafkafk
cafkafk deleted the BareMetal_provisioner branch April 26, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant