Add portainer_agent module and configure srv01-hf for it

This commit is contained in:
JuliusFreudenberger 2025-09-18 01:11:57 +02:00
parent fadfd47e3f
commit cfc8f986b7
3 changed files with 25 additions and 0 deletions

View file

@ -16,6 +16,7 @@
../../modules/qemu-guest.nix ../../modules/qemu-guest.nix
../../modules/docker.nix ../../modules/docker.nix
../../modules/teleport.nix ../../modules/teleport.nix
../../modules/portainer_agent.nix
../../modules/auto-upgrade.nix ../../modules/auto-upgrade.nix
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
@ -30,6 +31,8 @@
}; };
}; };
virtualisation.oci-containers.containers.portainer_agent.environmentFiles = [ config.age.secrets."portainer-join_token".path ];
systemd.network = { systemd.network = {
enable = true; enable = true;
networks."10-wan" = { networks."10-wan" = {

View file

@ -3,5 +3,6 @@
age.secrets = { age.secrets = {
teleport-ca_pin.file = "${inputs.secrets}/secrets/teleport/ca_pin"; teleport-ca_pin.file = "${inputs.secrets}/secrets/teleport/ca_pin";
teleport-join_token.file = "${inputs.secrets}/secrets/srv01-hf/teleport_auth_token"; teleport-join_token.file = "${inputs.secrets}/secrets/srv01-hf/teleport_auth_token";
portainer-join_token.file = "${inputs.secrets}/secrets/srv01-hf/portainer_join_token";
}; };
} }

View file

@ -0,0 +1,21 @@
{
...
}: {
virtualisation.oci-containers.containers = {
portainer_agent = {
image = "portainer/agent:2.33.1";
volumes = [
"/var/run/docker.sock:/var/run/docker.sock"
"/var/lib/docker/volumes:/var/lib/docker/volumes"
"/:/host"
];
environment = {
EDGE = "1";
CAP_HOST_MANAGEMENT = "1";
};
extraOptions = [
''--mount=type=volume,source=portainer_agent,target=/data,volume-driver=local''
];
};
};
}