forked from fediversity/fediversity
propagate datastore id
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
parent
b0b158050d
commit
b5d2b2cb87
7 changed files with 47 additions and 3 deletions
|
|
@ -30,6 +30,8 @@ let
|
|||
node-name
|
||||
bridge
|
||||
vlanId
|
||||
imageDatastoreId
|
||||
vmDatastoreId
|
||||
;
|
||||
inherit (lib) mkOption types;
|
||||
eval =
|
||||
|
|
@ -344,6 +346,8 @@ let
|
|||
node-name
|
||||
bridge
|
||||
vlanId
|
||||
imageDatastoreId
|
||||
vmDatastoreId
|
||||
;
|
||||
root-path = pathToRoot;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ let
|
|||
node-name = "pve";
|
||||
bridge = "br0";
|
||||
vlanId = 0;
|
||||
imageDatastoreId = "local";
|
||||
vmDatastoreId = "local";
|
||||
};
|
||||
# FIXME generate the image `nixos-generate` was to make, but now do it for a desired `-c configuration.nix` rather than whatever generic thing now
|
||||
deployment =
|
||||
|
|
|
|||
|
|
@ -44,5 +44,15 @@ in
|
|||
type = types.int;
|
||||
default = 0;
|
||||
};
|
||||
imageDatastoreId = mkOption {
|
||||
description = "ID of the datastore of the image.";
|
||||
type = types.str;
|
||||
default = "local";
|
||||
};
|
||||
vmDatastoreId = mkOption {
|
||||
description = "ID of the datastore of the VM.";
|
||||
type = types.str;
|
||||
default = "local";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -364,6 +364,16 @@ let
|
|||
type = types.int;
|
||||
default = 0;
|
||||
};
|
||||
imageDatastoreId = mkOption {
|
||||
description = "ID of the datastore of the image.";
|
||||
type = types.str;
|
||||
default = "local";
|
||||
};
|
||||
vmDatastoreId = mkOption {
|
||||
description = "ID of the datastore of the VM.";
|
||||
type = types.str;
|
||||
default = "local";
|
||||
};
|
||||
run = mkOption {
|
||||
type = types.package;
|
||||
# error: The option `tf-deployment.tf-host.run' is read-only, but it's set multiple times.
|
||||
|
|
@ -383,6 +393,8 @@ let
|
|||
node-name
|
||||
bridge
|
||||
vlanId
|
||||
imageDatastoreId
|
||||
vmDatastoreId
|
||||
;
|
||||
inherit (ssh)
|
||||
host
|
||||
|
|
@ -451,6 +463,8 @@ let
|
|||
proxmox_password = proxmox-password;
|
||||
ssh_user = username;
|
||||
vlan_id = vlanId;
|
||||
image_datastore_id = imageDatastoreId;
|
||||
vm_datastore_id = vmDatastoreId;
|
||||
};
|
||||
tf-env = pkgs.callPackage ./run/tf-env.nix {
|
||||
inherit httpBackend;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ resource "proxmox_virtual_environment_file" "upload" {
|
|||
# https://192.168.51.81:8006/#v1:0:=storage%2Fnode051%2Flocal:4::=contentIso:::::
|
||||
# PVE -> Datacenter -> Storage -> local -> Edit -> General -> Content -> check Import + Disk Images -> OK
|
||||
# that UI action also adds it in `/etc/pve/storage.cfg`
|
||||
datastore_id = "local"
|
||||
datastore_id = var.image_datastore_id
|
||||
# datastore_id = "local-lvm"
|
||||
# datastore_id = "backup"
|
||||
node_name = var.node_name
|
||||
|
|
@ -133,7 +133,7 @@ resource "proxmox_virtual_environment_vm" "nix_vm" {
|
|||
|
||||
disk {
|
||||
# datastore_id = "linstor_storage"
|
||||
datastore_id = "local"
|
||||
datastore_id = var.vm_datastore_id
|
||||
file_format = "qcow2"
|
||||
interface = "scsi0"
|
||||
discard = "on"
|
||||
|
|
@ -154,7 +154,7 @@ resource "proxmox_virtual_environment_vm" "nix_vm" {
|
|||
|
||||
efi_disk {
|
||||
# datastore_id = "linstor_storage"
|
||||
datastore_id = "local"
|
||||
datastore_id = var.vm_datastore_id
|
||||
file_format = "qcow2"
|
||||
type = "4m"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,6 +64,18 @@ variable "vlan_id" {
|
|||
default = 0
|
||||
}
|
||||
|
||||
variable "image_datastore_id" {
|
||||
description = "ID of the datastore of the image."
|
||||
type = string
|
||||
default = "local"
|
||||
}
|
||||
|
||||
variable "vm_datastore_id" {
|
||||
description = "ID of the datastore of the VM."
|
||||
type = string
|
||||
default = "local"
|
||||
}
|
||||
|
||||
#########################################
|
||||
|
||||
variable "category" {
|
||||
|
|
|
|||
|
|
@ -97,6 +97,8 @@
|
|||
node-name = "node051";
|
||||
bridge = "ovsbr0";
|
||||
vlanId = 1305;
|
||||
imageDatastoreId = "local";
|
||||
vmDatastoreId = "linstor_storage";
|
||||
};
|
||||
# opt not to pass `inputs`, as we could only pass serializable arguments through to its self-call
|
||||
})."tf-proxmox-deployment".tf-proxmox-host;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue