forked from fediversity/fediversity
rename deployment method to prep for separation
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
parent
9ede4a41f8
commit
c0e0aa1ee6
9 changed files with 13 additions and 13 deletions
|
|
@ -46,7 +46,7 @@ in
|
||||||
deployment-name,
|
deployment-name,
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
tf-proxmox-host = {
|
tf-proxmox-vm = {
|
||||||
nixos-configuration = mkNixosConfiguration environment required-resources;
|
nixos-configuration = mkNixosConfiguration environment required-resources;
|
||||||
system = targetSystem;
|
system = targetSystem;
|
||||||
ssh = {
|
ssh = {
|
||||||
|
|
|
||||||
|
|
@ -38,14 +38,14 @@ let
|
||||||
ipv6Gateway = "";
|
ipv6Gateway = "";
|
||||||
ipv6Address = "";
|
ipv6Address = "";
|
||||||
};
|
};
|
||||||
}).default.tf-proxmox-host;
|
}).default.tf-proxmox-vm;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
_class = "nixosTest";
|
_class = "nixosTest";
|
||||||
name = "deployment-model";
|
name = "deployment-model";
|
||||||
sourceFileset = lib.fileset.unions [
|
sourceFileset = lib.fileset.unions [
|
||||||
../../run/tf-proxmox/run.sh
|
../../run/tf-proxmox-vm/run.sh
|
||||||
../../run/tf-proxmox/await-ssh.sh
|
../../run/tf-proxmox-vm/await-ssh.sh
|
||||||
];
|
];
|
||||||
|
|
||||||
nodes.pve =
|
nodes.pve =
|
||||||
|
|
@ -114,7 +114,7 @@ in
|
||||||
pkgs.pve-manager
|
pkgs.pve-manager
|
||||||
pkgs.openssl
|
pkgs.openssl
|
||||||
pkgs.jq
|
pkgs.jq
|
||||||
(pkgs.callPackage ../../run/tf-proxmox/tf.nix { })
|
(pkgs.callPackage ../../run/tf-proxmox-vm/tf.nix { })
|
||||||
];
|
];
|
||||||
|
|
||||||
# needed only when building from deployer
|
# needed only when building from deployer
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,7 @@ let
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
tf-proxmox-host = mkOption {
|
tf-proxmox-vm = mkOption {
|
||||||
description = "A Terraform deployment by SSH to update a single existing NixOS host.";
|
description = "A Terraform deployment by SSH to update a single existing NixOS host.";
|
||||||
type = submodule (tf-host: {
|
type = submodule (tf-host: {
|
||||||
options = {
|
options = {
|
||||||
|
|
@ -395,7 +395,7 @@ let
|
||||||
key-file
|
key-file
|
||||||
sshOpts
|
sshOpts
|
||||||
;
|
;
|
||||||
deployment-type = "tf-proxmox-host";
|
deployment-type = "tf-proxmox-vm";
|
||||||
nixos_conf = writeConfig {
|
nixos_conf = writeConfig {
|
||||||
inherit
|
inherit
|
||||||
system
|
system
|
||||||
|
|
@ -464,10 +464,10 @@ let
|
||||||
};
|
};
|
||||||
tf-env = pkgs.callPackage ./run/tf-env.nix {
|
tf-env = pkgs.callPackage ./run/tf-env.nix {
|
||||||
inherit httpBackend;
|
inherit httpBackend;
|
||||||
tfPackage = pkgs.callPackage ./run/tf-proxmox/tf.nix { };
|
tfPackage = pkgs.callPackage ./run/tf-proxmox-vm/tf.nix { };
|
||||||
tfDirs = [
|
tfDirs = [
|
||||||
"deployment/run/tf-single-host"
|
"deployment/run/tf-single-host"
|
||||||
"deployment/run/tf-proxmox"
|
"deployment/run/tf-proxmox-vm"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
vm_name = "test14";
|
vm_name = "test14";
|
||||||
|
|
@ -478,7 +478,7 @@ let
|
||||||
pkgs.qemu
|
pkgs.qemu
|
||||||
pkgs.nixos-generators
|
pkgs.nixos-generators
|
||||||
pkgs.httpie
|
pkgs.httpie
|
||||||
(pkgs.callPackage ./run/tf-proxmox/tf.nix { })
|
(pkgs.callPackage ./run/tf-proxmox-vm/tf.nix { })
|
||||||
])
|
])
|
||||||
''
|
''
|
||||||
set -e
|
set -e
|
||||||
|
|
@ -499,7 +499,7 @@ let
|
||||||
env ${toString (lib.mapAttrsToList (k: v: "TF_VAR_${k}=\"${toBash v}\"") environment)} \
|
env ${toString (lib.mapAttrsToList (k: v: "TF_VAR_${k}=\"${toBash v}\"") environment)} \
|
||||||
${toString (lib.mapAttrsToList (k: v: "${k}=\"${toBash v}\"") httpBackend)} \
|
${toString (lib.mapAttrsToList (k: v: "${k}=\"${toBash v}\"") httpBackend)} \
|
||||||
TF_VAR_image=/tmp/${name}.qcow2 \
|
TF_VAR_image=/tmp/${name}.qcow2 \
|
||||||
tf_env=${tf-env} bash ./deployment/run/tf-proxmox/run.sh
|
tf_env=${tf-env} bash ./deployment/run/tf-proxmox-vm/run.sh
|
||||||
'';
|
'';
|
||||||
# # don't really wanna deal with having to do versioned updates for now
|
# # don't really wanna deal with having to do versioned updates for now
|
||||||
# qemu-img convert -f raw -O qcow2 -C "${machine.config.system.build.image}/${name}.raw" /tmp/${name}.qcow2
|
# qemu-img convert -f raw -O qcow2 -C "${machine.config.system.build.image}/${name}.raw" /tmp/${name}.qcow2
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare tf_env
|
||||||
# # on upload explodes RAM use + logs file content, causing timeout
|
# # on upload explodes RAM use + logs file content, causing timeout
|
||||||
# export TF_LOG=debug
|
# export TF_LOG=debug
|
||||||
|
|
||||||
cd "${tf_env}/deployment/run/tf-proxmox"
|
cd "${tf_env}/deployment/run/tf-proxmox-vm"
|
||||||
# parallelism=1: limit OOM risk
|
# parallelism=1: limit OOM risk
|
||||||
TF_LOG=info tofu apply --auto-approve -input=false -parallelism=1 >&2
|
TF_LOG=info tofu apply --auto-approve -input=false -parallelism=1 >&2
|
||||||
TF_LOG=error tofu output -json
|
TF_LOG=error tofu output -json
|
||||||
|
|
@ -110,7 +110,7 @@
|
||||||
# ipv6Address = "2a00:51c0:13:1305::${vm-id}";
|
# ipv6Address = "2a00:51c0:13:1305::${vm-id}";
|
||||||
};
|
};
|
||||||
# opt not to pass `inputs`, as we could only pass serializable arguments through to its self-call
|
# opt not to pass `inputs`, as we could only pass serializable arguments through to its self-call
|
||||||
})."tf-proxmox-deployment".tf-proxmox-host
|
})."tf-proxmox-deployment".tf-proxmox-vm
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue