mjolnir: use cloud-init for network configuration and move to new net.

Switch to cloud-init to align with the Ansible infra.
Also move to new network and hostname.
This commit is contained in:
June 2026-01-07 19:20:50 +01:00
commit c9e27a5bb6
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
2 changed files with 18 additions and 12 deletions

View file

@ -1,19 +1,25 @@
{ ... }:
{
networking = {
interfaces.net0 = {
ipv4.addresses = [
{
address = "172.31.17.161";
prefixLength = 25;
}
networking.useDHCP = false;
services.cloud-init = {
enable = true;
network.enable = true;
# Version without ssh of:
# https://github.com/NixOS/nixpkgs/blob/3c9db02515ef1d9b6b709fc60ba9a540957f661c/nixos/modules/services/system/cloud-init.nix#L145
# So we don't get ssh hostkey regenerations.
settings.cloud_config_modules = [
"disk_setup"
"mounts"
"ssh-import-id"
"set-passwords"
"timezone"
"disable-ec2-metadata"
"runcmd"
];
};
defaultGateway = "172.31.17.129";
nameservers = [ "212.12.50.158" "192.76.134.90" ];
search = [ "hamburg.ccc.de" ];
};
systemd.network.links."10-net0" = {
matchConfig.MACAddress = "BC:24:11:C9:F8:C5";

View file

@ -16,7 +16,7 @@
"targetHostname": "forgejo-actions-runner-intern.hamburg.ccc.de"
},
"mjolnir": {
"targetHostname": "mjolnir-intern.hamburg.ccc.de"
"targetHostname": "mjolnir.hosts.hamburg.ccc.de"
},
"woodpecker": {
"targetHostname": "woodpecker-intern.hamburg.ccc.de"