2023-06-29 17:11:13 +02:00
|
|
|
{ tflib, elib, secret, vars, ... }:
|
2023-06-15 23:06:47 +02:00
|
|
|
let
|
|
|
|
inherit (elib)
|
|
|
|
nfsVolume
|
|
|
|
nomadJob;
|
2023-06-29 17:11:13 +02:00
|
|
|
inherit (tflib)
|
|
|
|
tf;
|
2023-06-15 23:06:47 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
resource."nomad_volume"."ingress-letsencrypt" = nfsVolume {
|
|
|
|
volume_name = "ingress-letsencrypt";
|
|
|
|
access_mode = "single-node-writer";
|
|
|
|
server = secret.network.ips.blowhole.ip;
|
|
|
|
share = "/var/nfs/ingress-letsencrypt";
|
|
|
|
mount_flags = [ "nolock" "hard" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
resource."nomad_job"."ingress" = nomadJob {
|
2023-06-29 17:11:13 +02:00
|
|
|
count = tf "var.dont_deploy_containers ? 0 : 1";
|
2023-06-15 23:06:47 +02:00
|
|
|
jobspec = ./job.hcl;
|
|
|
|
vars = {
|
2023-06-19 00:41:49 +02:00
|
|
|
flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}";
|
|
|
|
flake_sha = vars.flake_sha;
|
2023-06-15 23:06:47 +02:00
|
|
|
upstreams = "\${file(\"${./upstreams.conf}\")}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|