# Configuration merging and resolution

> For the complete documentation index, see [llms.txt](https://docs.ringleader.dev/llms.txt).


> A workstation's resolved configuration is everything it is set up to match, after Ringleader merges its own settings with every layer that reaches it.


A workstation's resolved configuration is everything it is set up to match, after
Ringleader merges its own settings with every
[configuration layer](https://docs.ringleader.dev/workstations/configuration/configuration-layers/)
that reaches it. Read it when a workstation doesn't have what you expected: it shows the
merged result and which layers made it.

## Sources of the resolved configuration

Ringleader works out the resolved configuration when you ask for it. It starts from the
workstation and every layer that reaches it, by label or by name. For a cloud workstation,
it also uses the [CloudIdentity](https://docs.ringleader.dev/reference/resources/cloudidentity/) that gives
Ringleader its cloud credentials. It uses the same code that configures the workstation,
so the answer is what the workstation is set up to match.

For a workstation stored in the Ringleader console, the console works out the answer, not
your computer. That is the answer the console uses to configure the workstation.

The workstation's status doesn't hold the resolved configuration. Its
`status.config.effectiveHash` is a fingerprint of the configuration Ringleader wants the
workstation to have.

## Resolved configuration contents

The resolved configuration is longer than what you declared. It also carries the defaults
Ringleader filled in for you:

- the login user and shell
- the diagnostics settings
- the SSH keys Ringleader authorizes on the workstation
- the version of the in-VM agent the workstation should run

`${secret:NAME}` references appear as written, never as their values.

<div class="callout callout-tip">
  <p class="callout-title">Paste it into a ticket</p>
  <div class="callout-body">
    The command reads no Secret and needs no access to one, so you can paste its output into a
ticket.
  </div>
</div>


## Read a workstation's resolved configuration

To print the resolved configuration for a workstation, run:

```bash
rl workstation get-resolved-configuration my-box -n local
```

Add `-o json` for JSON. Three parts of the output answer most questions:

- `appliedConfigs`: which layers shaped the workstation, and which were dropped and why.
- `effective`: the whole merged result.
- `configCurrency`: whether the workstation's verdict on its configuration is still up to
  date.

[`rl workstation get-resolved-configuration`](https://docs.ringleader.dev/reference/cli/commands/workstation-access/#rl-workstation-get-resolved-configuration-name)
says what every key holds. In the terminal UI, press `V` on a workstation to describe it,
then `c`, as [The resolved configuration](https://docs.ringleader.dev/reference/tui/inspection-views/#the-resolved-configuration-c)
describes.

## Find which layer set a value

Not every setting goes to the highest-priority layer: lists combine, and a few blocks keep
the workstation's own value.
[Layer merge order](https://docs.ringleader.dev/workstations/configuration/configuration-layers/#layer-merge-order)
says how each kind of setting merges. When a value in `effective` isn't the one you
expected, follow these steps:

1. Check the workstation's own settings, and the defaults in
   [Resolved configuration contents](#resolved-configuration-contents). Neither appears
   in `appliedConfigs`.

   ```bash
   rl workstation get my-box -n local -o yaml
   ```

2. In `appliedConfigs`, find the layers with the highest `priority`, and read them, highest
   first, to find the one that sets the value:

   ```bash
   rl workstationconfig get <name> -n <namespace> -o yaml
   ```

3. If the layer you expected isn't there, check whether it is listed with
   `refused: true`. Its `reason`, such as `author-lacks-reach`, says why it was dropped.

## Wait for a change to be applied

After you change a workstation or one of its layers, the resolved configuration changes at
once, and the workstation then applies it. To wait until it has, run:

```bash
rl workstation wait my-box --for Configured --timeout 10m -n local
```

The command returns once the workstation's `Configured` condition, which says whether it
has applied its configuration, is `True`.
[`rl <kind> wait`](https://docs.ringleader.dev/reference/cli/commands/resource-verbs/#rl-kind-wait-name) lists its other
options.

`configCurrency` in the resolved configuration says the same thing. It is `current` when
the `Configured` verdict was worked out from the workstation and its layers as they are
now. It is `stale` when one of them has changed since.

## Next steps

- [Step failures and retries](https://docs.ringleader.dev/workstations/configuration/step-failures-retries/)
  explains what happens when a step in the configuration fails.
- [`rl diff`](https://docs.ringleader.dev/reference/cli/commands/resource-verbs/#rl-diff--f-file) shows how applying a file
  would change each object, before you apply it. It compares the objects, not their
  merged result.

