Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Applying configurations

navi apply is the core deployment command. It moves a set of nodes from their current state to the configuration described in the Hive.

navi apply --on web-01

With no goal given, apply runs the full sequence and is equivalent to switch. If activation fails, the previous generation stays active, so a bad deploy does not leave the machine broken.

The apply sequence

A full apply runs four stages for each node. It evaluates the node from the Hive, builds the resulting system closure, copies that closure to the target, and activates it. Each stage depends on the one before it, and a failure stops that node without affecting the others.

Deployment goals

apply takes an optional goal, given as a positional argument, that stops the sequence early:

  • build evaluates and builds only.
  • push also copies the closure to the target.
  • switch activates immediately and makes the change persist across reboots.
  • boot makes the change take effect on the next reboot only.

Running apply with no goal is equivalent to switch.

navi apply build --on web-01      # evaluate and build, deploy nothing
navi apply switch --on web-01 -v

The build goal is covered on its own in Builds; use it in continuous integration to verify that every node still evaluates and builds.

Selecting nodes

The --on flag chooses which nodes to act on. It accepts names, globs, and tags, so one command targets a single machine or a whole class of them. With no --on, Navi acts on every node in the Hive. Selection is shared across every subcommand and is documented in Selectors and tags.

navi apply --on web-01,web-02 switch -v
navi apply --on @web switch -v

Verbosity

-v makes a run verbose. It turns off the progress spinner and prints every line of output, which is what you want when a deploy is misbehaving.

Rebooting

Pass --reboot to reboot each node after activation and wait for it to come back before reporting success. Paired with the boot goal, this is how you confirm a configuration survives a real boot, not just a live activation.

navi apply boot --reboot --on web-01
navi apply switch --reboot --on web-01 -v

Parallelism

Navi applies to multiple nodes at once. The daemon manages the connection pool and task queue, so a large fleet deploys concurrently rather than one node at a time. Concurrency limits keep the local machine and the network from being overwhelmed.

Local deployment

To apply the local machine's own configuration without SSH, use navi apply-local. This is the right command for a machine that deploys itself, such as a workstation or a bootstrap host. It needs --sudo to escalate privileges when not run as root:

navi apply-local --sudo -v
navi apply-local boot --sudo -v

The same goals apply. push is a no-op locally, since there is nothing to copy.