Repository navigation
feat: add support for bare-metal provisioning - #16
Merged
Merged
Conversation
…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.
Owner
Author
|
Works, but I'll test it a bit more before merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BareMetalprovisioner type to support nodes withoutinfrastructure-as-code providers, allowing manual IP resolution via
CLI or interactive prompt.
forceHwLinksupport forSSHhosts, enabling connectionsto bypass overlay networks (like Tailscale) by binding to physical
interfaces via
socat.Sshstruct to reuse implementation between initrd and standard deployment
SSH connections.
--ipflag toprovisioncommand to skip interactive IP promptsfor bare-metal hosts.