2023-06-29 17:11:13 +02:00
|
|
|
{ config, tflib, elib, vars, ... }:
|
2023-06-15 23:07:28 +02:00
|
|
|
let
|
|
|
|
inherit (elib)
|
|
|
|
nfsVolume
|
|
|
|
nomadJob;
|
2023-06-29 17:11:13 +02:00
|
|
|
inherit (tflib)
|
|
|
|
tf;
|
2023-06-15 23:07:28 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
resource."nomad_volume"."hydra-db" = nfsVolume {
|
|
|
|
volume_name = "hydra-db";
|
|
|
|
access_mode = "single-node-writer";
|
|
|
|
server = "blowhole.hosts.in.redalder.org";
|
|
|
|
share = "/var/nfs/hydra-db";
|
|
|
|
mount_flags = [ "nfsvers=3" "hard" "async" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
resource."nomad_volume"."hydra-data" = nfsVolume {
|
|
|
|
volume_name = "hydra-data";
|
|
|
|
access_mode = "single-node-writer";
|
|
|
|
server = "blowhole.hosts.in.redalder.org";
|
|
|
|
share = "/var/nfs/hydra-data";
|
|
|
|
mount_flags = [ "nfsvers=3" "hard" "async" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
resource."nomad_volume"."hydra-nix" = nfsVolume {
|
|
|
|
volume_name = "hydra-nix";
|
|
|
|
access_mode = "single-node-writer";
|
|
|
|
server = "blowhole.hosts.in.redalder.org";
|
|
|
|
share = "/var/nfs/hydra-nix";
|
|
|
|
mount_flags = [ "nfsvers=3" "hard" "async" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
resource."vault_policy"."hydra-policy" = {
|
|
|
|
name = "hydra-policy";
|
|
|
|
policy = ''
|
|
|
|
path "kv/data/hydra" {
|
|
|
|
capabilities = ["read"]
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
resource."nomad_job"."hydra" = nomadJob {
|
2023-06-29 17:11:13 +02:00
|
|
|
count = tf "var.dont_deploy_containers ? 0 : 1";
|
2023-06-15 23:07:28 +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:07:28 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|