Docs: align workflow, remove targetHost before deployment

This commit is contained in:
Johannes Kirschbauer
2025-07-12 16:34:48 +02:00
parent 821f5c2bc2
commit 6d24117d0c
2 changed files with 14 additions and 25 deletions

View File

@@ -51,15 +51,12 @@ See the complete [list](../../guides/more-machines.md#automatic-registration) of
Add the following to your `clan.nix` file for each machine. Add the following to your `clan.nix` file for each machine.
This example demonstrates what is needed based on a machine called `jon`: This example demonstrates what is needed based on a machine called `jon`:
```{.nix .annotate title="clan.nix" hl_lines="3-9 18-22"} ```{.nix .annotate title="clan.nix" hl_lines="3-6 15-19"}
{ {
inventory.machines = { inventory.machines = {
jon = { jon = {
# Define targetHost here
# Required before deployment
deploy.targetHost = "root@jon"; # (1)
# Define tags here (optional) # Define tags here (optional)
tags = [ ]; # (3) tags = [ ]; # (1)
}; };
sara = { sara = {
deploy.targetHost = "root@sara"; deploy.targetHost = "root@sara";
@@ -78,9 +75,8 @@ This example demonstrates what is needed based on a machine called `jon`:
} }
``` ```
1. It is required to define a *targetHost* for each machine before deploying. Best practice has been, to use the zerotier ip/hostname or the ip from the from overlay network you decided to use. 1. Tags can be used to automatically add this machine to services later on. - You dont need to set this now.
2. Add your *ssh key* here - That will ensure you can always login to your machine via *ssh* in case something goes wrong. 2. Add your *ssh key* here - That will ensure you can always login to your machine via *ssh* in case something goes wrong.
3. Tags can be used to automatically add this machine to services later on. - You dont need to set this now.
### (Optional) Create a `configuration.nix` ### (Optional) Create a `configuration.nix`

View File

@@ -17,15 +17,11 @@ To learn more: [Guide about clanService](../clanServices.md)
## Configure a Zerotier Network (recommended) ## Configure a Zerotier Network (recommended)
```{.nix title="clan.nix" hl_lines="12-20"} ```{.nix title="clan.nix" hl_lines="8-16"}
{ {
inventory.machines = { inventory.machines = {
jon = { jon = { };
targetHost = "root@jon"; sara = { };
};
sara = {
targetHost = "root@jon";
};
}; };
inventory.instances = { inventory.instances = {
@@ -55,31 +51,27 @@ To learn more: [Guide about clanService](../clanServices.md)
Adding the following services is recommended for most users: Adding the following services is recommended for most users:
```{.nix title="clan.nix" hl_lines="11-26"} ```{.nix title="clan.nix" hl_lines="7-22"}
{ {
inventory.machines = { inventory.machines = {
jon = { jon = { };
targetHost = "root@jon"; sara = { };
};
sara = {
targetHost = "root@jon";
};
}; };
inventory.instances = { inventory.instances = {
admin = { # (1) admin = { # (1)
roles.default.tags.all = { }; roles.default.tags.all = { };
roles.default.settings = { roles.default.settings = {
allowedKeys = { allowedKeys = {
"my-user" = "ssh-ed25519 AAAAC3N..."; # elided "my-user" = "ssh-ed25519 AAAAC3N..."; # (2)
}; };
}; };
}; };
jon-user = { # (2) jon-user = { # (3)
module.name = "users"; module.name = "users";
roles.default.tags.all = { }; roles.default.tags.all = { };
roles.default.settings = { roles.default.settings = {
user = "jon"; # (3) user = "jon";
}; };
}; };
# ... # ...
@@ -90,4 +82,5 @@ Adding the following services is recommended for most users:
``` ```
1. The `admin` service will generate a **root-password** and **add your ssh-key** that allows for convienient administration. 1. The `admin` service will generate a **root-password** and **add your ssh-key** that allows for convienient administration.
2. Adds `jon` as a user on all machines. Will create a `home` directory, and prompt for a password before deployment. 2. Equivalent to directly setting `authorizedKeys` like in [configuring a machine](./add-machines.md#configuring-a-machine)
3. Adds `user = jon` as a user on all machines. Will create a `home` directory, and prompt for a password before deployment.