feat: tfvars, efi and pushing to code.tjo.space
This commit is contained in:
parent
797416e0fc
commit
19678552e6
4 changed files with 36 additions and 5 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -14,8 +14,8 @@ crash.*.log
|
|||
# password, private keys, and other secrets. These should not be part of version
|
||||
# control as they are data points which are potentially sensitive and subject
|
||||
# to change depending on the environment.
|
||||
*.tfvars
|
||||
*.tfvars.json
|
||||
#*.tfvars
|
||||
#*.tfvars.json
|
||||
|
||||
# Ignore override files as they are usually used to override resources locally and so
|
||||
# are not checked in
|
||||
|
|
18
justfile
18
justfile
|
@ -15,11 +15,23 @@ lint:
|
|||
build:
|
||||
@nix build .#vm
|
||||
|
||||
push:
|
||||
#!/usr/bin/env sh
|
||||
export NIXOS_IMAGE=$(nix path-info --quiet .#vm)/nixos.qcow2
|
||||
export VERSION=$(echo $NIXOS_IMAGE | cut -d'/' -f4 | cut -d'-' -f1)
|
||||
|
||||
echo "Uploading $NIXOS_IMAGE to code.tjo.space"
|
||||
echo "Version: $VERSION"
|
||||
|
||||
curl --user $CODE_TJO_SPACE_USER:$CODE_TJO_SPACE_TOKEN \
|
||||
--progress-bar \
|
||||
--upload-file $NIXOS_IMAGE \
|
||||
https://code.tjo.space/api/packages/tjo-cloud/generic/ingress/${VERSION}/nixos.qcow2
|
||||
|
||||
deploy:
|
||||
#!/usr/bin/env sh
|
||||
export NIX_RESULT_DIR=$(nix build --print-out-paths .#vm)
|
||||
export IMAGE_NAME=$(ls ${NIX_RESULT_DIR} | grep ".qcow2")
|
||||
export TF_VAR_image_path=${NIX_RESULT_DIR}/${IMAGE_NAME}
|
||||
export NIXOS_IMAGE=$(nix path-info --quiet .#vm)/nixos.qcow2
|
||||
export TF_VAR_image_path=$NIXOS_IMAGE
|
||||
|
||||
cd {{justfile_directory()}}/terraform
|
||||
tofu init
|
||||
|
|
|
@ -89,6 +89,9 @@ resource "proxmox_virtual_environment_vm" "nodes" {
|
|||
}
|
||||
|
||||
bios = "ovmf"
|
||||
efi_disk {
|
||||
datastore_id = each.value.storage
|
||||
}
|
||||
|
||||
operating_system {
|
||||
type = "l26"
|
||||
|
|
16
terraform/terraform.tfvars
Normal file
16
terraform/terraform.tfvars
Normal file
|
@ -0,0 +1,16 @@
|
|||
nodes = {
|
||||
de_01 = {
|
||||
name = "de-01"
|
||||
host = "hetzner"
|
||||
bridge = "vmprivate0"
|
||||
cloudinit = ""
|
||||
}
|
||||
de_02 = {
|
||||
name = "de-02"
|
||||
host = "hetzner"
|
||||
bridge = "vmprivate0"
|
||||
cloudinit = ""
|
||||
}
|
||||
}
|
||||
|
||||
common_storage = "proxmox-backup-tjo-cloud"
|
Loading…
Reference in a new issue